Is it possible to do this :
CREATE TABLE sorted (order_no SERIAL PRIMARY KEY, other columns...)
INSERT INTO sorted (columns) SELECT * FROM main_table INNER JOIN
key_table ON main_table.id = key_table.main_table_id WHERE key = 'param'
ORDER BY value SELECT
The SERIAL will automat
Hi, Ben,
Ben K. schrieb:
> I tried int8(id) but java didn't take it as Integer. (It took int8 as
> something like Long.)
Yes, and that's good, as PostgreSQL int8 and java long actually are the
same datatype (64-bit signed two's-complement).
PostgreSQL int4 and Java int are the same (32-bit), as
CREATE TABLE sorted (order_no SERIAL PRIMARY KEY, other columns...)
INSERT INTO sorted (columns) SELECT * FROM main_table INNER JOIN
key_table ON main_table.id = key_table.main_table_id WHERE key = 'param' ORDER
BY value SELECT
The SERIAL will automatically generate the order_no you wa
Another version along that line ?
# create sequence counterseq start 1;
-- (set/reset whenever a counter is needed)
# select main_table.*, nextval('counterseq') as position2
into sorted_main_table
from main_table, keytable where main_table.id =
keytable.main_table_id
order by value
Jorge Godoy wrote:
> I have some real case examples where this could be useful, if it is needed.
> I haven't pasted them here because the smallest one has 176 LOC, after
> refactoring with nested functions.
>
> If it is not possible, are there any plans to allow this kind of thing?
> (Even with
Em Domingo 07 Maio 2006 20:33, Alvaro Herrera escreveu:
>
> We don't support nested functions at present, but you can create a
> separate function and invoke it as you would call any external function.
Yeah, I know it and that's how I use some things today, but even so, having
nested functions he