Search Postgresql Archives

Re: Create Table Question...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jerry LeVan <jerry.levan@xxxxxxxxx> writes:
> Here is a fragment of sql that I frequently use:
> *************
> insert into checks (select *
>    from dblink('select * from checks where date >=''1/1/2011''')
>    as (date date,
>        amount numeric(9,2),
>         tranid text,
>        source text,
>        memo text,
>        status text,
>        category text
>       ) );
> **************
> The stuff after the 'as' is a description of the
> rows of the table checks.

> Could I shortened the above by using the automatically created row type of
> the table checks?

Unfortunately not.  It's not an unreasonable suggestion, though I'm not
sure how we'd fit it into the syntax.  Maybe we could allow casting
to resolve the output type of the function, a la

	select ... from dblink('query')::checks

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux