Home > create table > error column row has pseudo-type record

Error Column Row Has Pseudo-type Record

Contents

8.2 / 8.3 / 8.4 / 9.0 PostgreSQL 8.2.23 Documentation Prev Fast Backward Chapter 8. Data Types Fast Forward Next 8.13. Pseudo-Types The PostgreSQL type system contains a number of special-purpose entries that are collectively postgresql create table from select called pseudo-types. A pseudo-type cannot be used as a column data type, but it can be

Postgres Create Table From Another Table

used to declare a function's argument or result type. Each of the available pseudo-types is useful in situations where a function's behavior does

Postgresql Insert Into Select

not correspond to simply taking or returning a value of a specific SQL data type. Table 8-20 lists the existing pseudo-types. Table 8-20. Pseudo-Types Name Description any Indicates that a function accepts any input data type whatever. anyarray

Postgres Create Table Like

Indicates that a function accepts any array data type (see Section 33.2.5). anyelement Indicates that a function accepts any data type (see Section 33.2.5). cstring Indicates that a function accepts or returns a null-terminated C string. internal Indicates that a function accepts or returns a server-internal data type. language_handler A procedural language call handler is declared to return language_handler. record Identifies a function returning an unspecified row type. trigger A trigger function is declared to return postgres copy table trigger. void Indicates that a function returns no value. opaque An obsolete type name that formerly served all the above purposes. Functions coded in C (whether built-in or dynamically loaded) may be declared to accept or return any of these pseudo data types. It is up to the function author to ensure that the function will behave safely when a pseudo-type is used as an argument type. Functions coded in procedural languages may use pseudo-types only as allowed by their implementation languages. At present the procedural languages all forbid use of a pseudo-type as argument type, and allow only void and record as a result type (plus trigger when the function is used as a trigger). Some also support polymorphic functions using the types anyarray and anyelement. The internal pseudo-type is used to declare functions that are meant only to be called internally by the database system, and not by direct invocation in a SQL query. If a function has at least one internal-type argument then it cannot be called from SQL. To preserve the type safety of this restriction it is important to follow this coding rule: do not create any function that is declared to return internal unless it has at least one internal argument. Prev Home Next Object Identifier Types Up XML Document Support Submit correction If you see anything in the documentation that is

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and select into postgres policies of this site About Us Learn more about Stack Overflow the distinct on company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags postgres create index Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes https://www.postgresql.org/docs/8.2/static/datatype-pseudo.html a minute: Sign up Including a set of rows in a view column up vote 1 down vote favorite Design: A main table where each entry in it can have zero of more of a set of options “checked”. It seems to me that it would be easier to maintain (adding/removing options) if the options were part of a separate table http://stackoverflow.com/questions/7097126/including-a-set-of-rows-in-a-view-column and a mapping was made between the main table and an options table. Goal: A view that contains the information from the main table, as well as all options to which that row has been mapped. However the latter information exists in the view, it should be possible to extract the option’s ID and its description easily. The implementation below is specific to PostgreSQL, but any paradigm that works across databases is of interest. The select statement that does what I want is: WITH tmp AS ( SELECT tmap.MainID AS MainID, array_agg(temp_options) AS options FROM tstng.tmap INNER JOIN (SELECT id, description FROM tstng.toptions ORDER BY description ASC) AS temp_options ON tmap.OptionID = temp_options.id GROUP BY tmap.MainID ) SELECT tmain.id, tmain.contentcolumns, tmp.options FROM tstng.tmain INNER JOIN tmp ON tmain.id = tmp.MainID; However, attempting to create a view from this select statement generates an error: column "options" has pseudo-type record[] The solution that I’ve found is to cast the array of options (record[]) to a text array (text[][]); however, I’m interested in knowing if there is a better solution out there. For reference

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business http://stackoverflow.com/questions/19126148/pl-pgsql-return-query-gives-psuedo-type-record-rather-than-table Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up PL/pgSQL Return Query gives psuedo-type record rather than table up vote 0 down vote favorite My first PL/pgSQL function is designed to take create table a geometry column as input and output a fishnet/grid table (a common task for me). I'm not sure what I'm doing wrong on the return statement, though, as I'm getting back a pseudo-type record instead of a table with distinct columns. My code: CREATE OR REPLACE FUNCTION ST_Fishnet( nrow integer, ncol integer, geo_table varchar, geom_column varchar) RETURNS Table( ids text, geom geometry) AS $$ DECLARE collected_geom geometry; xmin numeric; xmax numeric; ymin numeric; ymax numeric; create table from xsize numeric; ysize numeric; BEGIN EXECUTE 'SELECT st_collect("'||$4||'") FROM "'||$3||'"' INTO collected_geom; xmax := st_xmin(collected_geom); xmin := st_xmax(collected_geom); ymin := st_ymin(collected_geom); ymax := st_ymax(collected_geom); xsize := abs(xmax - xmin) / $2; ysize := abs(ymax - ymin) / $1; RETURN QUERY SELECT i+1||'-'||j+1 as ids, ST_Translate(cell, j * xsize + xmax, i * ysize + ymin) AS geom FROM generate_series(0, $1 - 1) AS i, generate_series(0, $2 - 1) AS j, (SELECT ('POLYGON((0 0, 0 '||ysize||', '||xsize||' '||ysize||', '||xsize||' 0,0 0))')::geometry AS cell) AS temp; END $$ LANGUAGE plpgsql; The output should look like a table with ids and geom columns, but comes out, instead as a pseudo type looking like: (1-1,01030000[...]40) Have read through the docs, and I'm still unsure what I'm doing wrong. Appreciate any pointers. Thanks. postgresql postgis plpgsql share|improve this question edited Oct 1 '13 at 21:54 asked Oct 1 '13 at 21:20 JMcClure 78210 possible duplicate of RETURN QUERY-Record in PostgreSQL –Erwin Brandstetter Oct 2 '13 at 0:23 Don't cross-post: gis.stackexchange.com/questions/73076/… –Mike T Oct 2 '13 at 2:40 add a comment| 1 Answer 1 active oldest votes up vote 2 down vote accepted Figured it out. Calling the function SELECT * FROM ST_Fishnet(rows, columns, geo-table, the_geom)produced the desired table. share|improve this answer answered Oct 1 '13 at 22:00 JMcClure 78210 add a comment| You

 

Related content

1005 cannot create table error 150

Cannot Create Table Error table id toc tbody tr td div id toctitle Contents div ul li a href Error Can t Create Table errno a li li a href Error Can t Create Table db errno a li li a href Can t Create Table errno Mysql a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you might have relatedl Meta Discuss the workings and policies of this site About error hy can t create table errno Us Learn more about Stack Overflow the company

cannot create table error 121 mysql

Cannot Create Table Error Mysql table id toc tbody tr td div id toctitle Contents div ul li a href Errno Mysql Can t Create Table a li li a href Errno Mysql Foreign Key a li li a href Can t Create Table Errno a li li a href Mysql Error Code Can t Create Table errno a li ul td tr tbody table p here for a quick overview of the site Help relatedl Center Detailed answers to any questions you might p h id Errno Mysql Can t Create Table p have Meta Discuss the workings and

create table syntax error sql

Create Table Syntax Error Sql table id toc tbody tr td div id toctitle Contents div ul li a href Syntax Error In Create Table Statement Access a li li a href Syntax Error In Field Definition Create Table a li li a href Postgresql Create Table Syntax Error a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the relatedl company Business Learn more about hiring developers

create table syntax error mysql

Create Table Syntax Error Mysql table id toc tbody tr td div id toctitle Contents div ul li a href Syntax Error In Create Table Statement Access a li li a href Create Table Mysql Syntax a li li a href Mysql Create Table Example a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta relatedl Discuss the workings and policies of this site About mysql create table syntax error Us Learn more about Stack Overflow the company Business Learn more about hiring

error 1113 42000

Error p Search Username Password Remember Me Register Lost Password facebook google twitter rss Free Web Developer Tools Advanced Search xf Forum Databases MySQL Help ERROR A table must have at least column Thread relatedl ERROR A table must have at least column Share mysql create table example This Thread xf Tweet This this Post To Linkedin Subscribe to this Thread create table in mysql xf xf Subscribe to This Thread July th PM No Profile Picture a PhoenixTear View Profile View Forum Posts xf Registered User Devshed Newbie - posts xf c Join Date Jul Posts Rep Power ERROR

error 1113 mysql

Error Mysql table id toc tbody tr td div id toctitle Contents div ul li a href Create Table In Mysql a li ul td tr tbody table p Search Username Password Remember Me Register Lost Password facebook google twitter rss Free Web Developer Tools Advanced Search xf Forum Databases MySQL Help ERROR A table relatedl must have at least column Thread ERROR A mysql create table example table must have at least column Share This Thread xf Tweet This p h id Create Table In Mysql p this Post To Linkedin Subscribe to this Thread xf xf Subscribe to

error 150 in mysql create table

Error In Mysql Create Table table id toc tbody tr td div id toctitle Contents div ul li a href Error No In Mysql a li li a href Can T Create Table Errno a li li a href Mysql Error Can t Create Table a li ul td tr tbody table p here for a quick overview of the site Help Center relatedl Detailed answers to any questions you might have Meta mysql can t create table errno foreign key Discuss the workings and policies of this site About Us Learn errno mysql foreign key more about Stack Overflow

error 150 mysql create table

Error Mysql Create Table table id toc tbody tr td div id toctitle Contents div ul li a href Mysql Can t Create Table Errno Foreign Key a li li a href Errno Mysql Foreign Key a li li a href Supports Transactions Row-level Locking And Foreign Keys a li li a href Can T Create Table Errno Django a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site relatedl About Us Learn more about

error code 1005 mysql errno 150

Error Code Mysql Errno table id toc tbody tr td div id toctitle Contents div ul li a href Error Code Can t Create Table errno a li li a href Mysql Error Number a li li a href Mysql Error Hy Can T Create Table Errno a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you might have relatedl Meta Discuss the workings and policies of this site About mysql workbench error code can t create table errno Us Learn more about Stack Overflow the

error no 150 in mysql

Error No In Mysql table id toc tbody tr td div id toctitle Contents div ul li a href Mysql Error Can t Create Table a li li a href Error hy Can t Create Table errno a li li a href Can t Create Table Errno a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any relatedl questions you might have Meta Discuss the workings mysql error hy and policies of this site About Us Learn more about Stack Overflow p h id Mysql Error Can t

microsoft access syntax error in create table statement

Microsoft Access Syntax Error In Create Table Statement table id toc tbody tr td div id toctitle Contents div ul li a href Syntax Error In Create Table Statement Access a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings relatedl and policies of this site About Us Learn more about syntax error in create table statement access Stack Overflow the company Business Learn more about hiring developers or posting ads with p h id Syntax Error In Create Table

mysql create table error number 150

Mysql Create Table Error Number table id toc tbody tr td div id toctitle Contents div ul li a href Mysql Errno Create Table a li li a href Mysql Can t Create Table Errno a li li a href Mysql Can t Create Table Errno Foreign Key a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site relatedl About Us Learn more about Stack Overflow the company Business Learn mysql cannot create table error

mysql create error 150

Mysql Create Error table id toc tbody tr td div id toctitle Contents div ul li a href Errno Mysql Foreign Key a li li a href Error Code Can t Create Table errno a li li a href Error hy Can t Create Table errno a li li a href Can T Create Table Errno a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the relatedl workings and policies of this site About Us Learn more p h id Errno

mysql create table error

Mysql Create Table Error table id toc tbody tr td div id toctitle Contents div ul li a href Error Mysql Create Database a li li a href Mysql Create Table Example a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the relatedl workings and policies of this site About Us Learn more mysql create table error about Stack Overflow the company Business Learn more about hiring developers or posting p h id Error Mysql Create Database p ads with us

mysql database error cannot create table errno 150

Mysql Database Error Cannot Create Table Errno table id toc tbody tr td div id toctitle Contents div ul li a href Can t Create Table errno a li li a href Can t Create Table errno Foreign Key Constraint Is Incorrectly Formed a li li a href Error On Rename Of errno a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed relatedl answers to any questions you might have Meta mysql can t create table errno foreign key Discuss the workings and policies of this site About Us Learn

mysql cannot create table error no 150

Mysql Cannot Create Table Error No table id toc tbody tr td div id toctitle Contents div ul li a href Errno Mysql Foreign Key a li li a href Error hy Can t Create Table errno a li li a href Mysql Errno Alter Table a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site relatedl About Us Learn more about Stack Overflow the company Business Learn mysql can t create table errno foreign

mysql error no. 150 create table

Mysql Error No Create Table table id toc tbody tr td div id toctitle Contents div ul li a href Errno Mysql Foreign Key a li li a href Mysql Errno Alter Table a li li a href Can t Create Table errno Foreign Key Constraint Is Incorrectly Formed a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you relatedl might have Meta Discuss the workings and policies of mysql can t create table errno foreign key this site About Us Learn more about Stack Overflow

mysql error create table 1064

Mysql Error Create Table table id toc tbody tr td div id toctitle Contents div ul li a href Error Mysql Create Database a li li a href Create Table Mysql a li ul td tr tbody table p here for a quick overview of the site Help relatedl Center Detailed answers to any questions you might error mysql create table have Meta Discuss the workings and policies of this site About p h id Error Mysql Create Database p Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting error you have an

mysql workbench create table error 1064

Mysql Workbench Create Table Error table id toc tbody tr td div id toctitle Contents div ul li a href Mysql Error a li li a href Error Code Mysql Create Table a li li a href Error Code You Have An Error In Your Sql Syntax a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn relatedl more about Stack Overflow the company Business Learn more about hiring developers error mysql

navicat error 150

Navicat Error table id toc tbody tr td div id toctitle Contents div ul li a href Mysql Can t Create Table Errno Foreign Key a li li a href Mysql Error Can t Create Table a li li a href Error Hy Can T Create Table Errno a li ul td tr tbody table p Premium Apply Navicat Version No All Contents MySQL MariaDB PostgreSQL Oracle SQLite MySQL MariaDB If you receive MySQL Error likes Can't create relatedl table ' mydb sql- c c frm' errno it is caused by failure on creating can t create table errno mysql

navicat and error 150

Navicat And Error table id toc tbody tr td div id toctitle Contents div ul li a href Errno Mysql Foreign Key a li li a href Navicat Foreign Key Tutorial a li li a href Error Hy Can T Create Table Errno a li ul td tr tbody table p Premium Apply Navicat Version No All Contents MySQL MariaDB PostgreSQL Oracle SQLite MySQL MariaDB If you receive MySQL relatedl Error likes Can't create table ' mydb sql- c c frm' errno it is can t create table errno mysql caused by failure on creating Foreign Keys There are some

ora-01045 error

Ora- Error table id toc tbody tr td div id toctitle Contents div ul li a href What Is Create Session Privilege a li li a href Create Table Insufficient Privileges Oracle a li li a href Oracle Insufficient Privileges a li li a href Grant Create Table To User a li ul td tr tbody table p CommunityOracle User Group CommunityTopliners CommunityOTN Speaker BureauJava CommunityError You don't have JavaScript enabled This tool uses JavaScript and much of it will not work correctly relatedl without it enabled Please turn JavaScript back on p h id What Is Create Session Privilege

postgres create table like syntax error

Postgres Create Table Like Syntax Error table id toc tbody tr td div id toctitle Contents div ul li a href Postgresql Create Table Primary Key a li li a href Create Table If Not Exists Postgres a li li a href Postgres Select Into Temp Table a li li a href Postgres Drop Table If Exists a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn relatedl more about Stack Overflow

postgresql create table if not exists error

Postgresql Create Table If Not Exists Error table id toc tbody tr td div id toctitle Contents div ul li a href Postgres Create Database If Not Exists a li li a href Postgresql Insert Into Table a li ul td tr tbody table p PostgreSQL Documentation Prev Up Next CREATE TABLE NameCREATE TABLE--define a new table Synopsis CREATE GLOBAL relatedl LOCAL TEMPORARY TEMP UNLOGGED TABLE postgresql create index if not exists IF NOT EXISTS table name column name data type COLLATE collation column constraint postgres create table if not exists example table constraint LIKE source table like option INHERITS

postgresql create table like syntax error

Postgresql Create Table Like Syntax Error table id toc tbody tr td div id toctitle Contents div ul li a href Postgres Create Table Foreign Key a li li a href Create Table In Postgresql Pgadmin a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions relatedl you might have Meta Discuss the workings and policies postgresql create table example of this site About Us Learn more about Stack Overflow the company postgres create table auto increment primary key Business Learn more about hiring developers or posting

postgresql create table syntax error

Postgresql Create Table Syntax Error table id toc tbody tr td div id toctitle Contents div ul li a href Postgres Create Table Auto increment Primary Key a li li a href Create Table In Postgresql Pgadmin a li li a href Postgres Create Table Like a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers relatedl to any questions you might have Meta Discuss postgresql create table example the workings and policies of this site About Us Learn more about p h id Postgres Create Table Auto increment Primary