bioncamping.blogg.se

Postgresql insert into select and values
Postgresql insert into select and values







postgresql insert into select and values

(Of course, just for completeness, there is an environment variable, DELIMIDENT, that can be set - to any value, but Y is safest - to indicate that double quotes always surround delimited identifiers and single quotes always surround strings.) With Informix, you can use them only around owner names - in other contexts, Informix treats both single-quoted and double-quoted strings as strings, rather than separating single-quoted strings as strings and double-quoted strings as delimited identifiers. With standard SQL, delimited identifiers can be used many places. If you enclose the owner name in double quotes, it acts like a delimited identifier. )Īnd the owner name in the system catalog would be "SOMEONE", rather than 'someone'.

postgresql insert into select and values

That is, in a MODE ANSI database (not commonly used), you could write: CREATE TABLE someone.table (. With Informix, there's a mild complication with MODE ANSI databases, where owner names are generally converted to upper-case (informix is the exception). That is: someone.tableĪll identify the same table. Thus, in Informix, any of the following notations could identify a table: owner in general does not need to be quoted however, if you do use quotes, you need to get the owner name spelled correctly - it becomes case-sensitive. The SQL standard uses the term schema for what Informix calls the owner. With Informix, you can use the following notation to identify a table: is, you may specify a database, optionally identifying the server that hosts that database if it is not in the current server, followed by an optional owner, dot, and finally the actual table name. What can be different between systems is the notation used to identify tables in different databases - the standard has nothing to say about inter-database (let alone inter-DBMS) operations. In the absence of the column list, the first column of the result of the SELECT goes into the first column of the target table. (Once upon 5 or more years ago, this is the sort of thing that MySQL did not always support it now has decent support for this sort of standard SQL syntax and, AFAIK, it would work OK on this notation.) The column list is optional but indicates the target columns in sequence, so the first column of the result of the SELECT will go into the first listed column, etc.

postgresql insert into select and values

Works fine with Informix and, I would expect, all the DBMS. That is, the notation: INSERT INTO target_table SELECT. Both the answers I see work fine in Informix specifically, and are basically standard SQL.









Postgresql insert into select and values