Re: [SQL] select column by position

2004-09-24 Thread Chester Kustarz
On Fri, 24 Sep 2004, Jennifer Lee wrote: > Is there a way to select a column in a table by its position rather than > the field name? If I understand correctly column position in a table is > fixed. I've not been able to find anything in the archives or docs to > indicate that it's possible to sele

Re: [SQL] [GENERAL] need ``row number``

2004-09-24 Thread Greg Stark
Tom Lane <[EMAIL PROTECTED]> writes: > Karsten Hilbert <[EMAIL PROTECTED]> writes: > > I am not convinced I'll need a SRF. I am not trying to > > calculate something that isn't there yet. I am just trying to > > join two views appropriately. I might have to employ some > > variant of Celko's integ

[SQL] How to insert values in bytea?

2004-09-24 Thread Oliver Nolden
Hi everyone, I have a table with a bytea-column: CREATE TABLE picture( id int primary key, preview bytea NOT NULL); How can I insert a value in the bytea-column 'preview'? The function 'lo_import()' does only work for oid. But what is about bytea? If somebody has any suggestions or ideas, th

Re: [SQL] [GENERAL] need ``row number``

2004-09-24 Thread Tom Lane
Karsten Hilbert <[EMAIL PROTECTED]> writes: > I am not convinced I'll need a SRF. I am not trying to > calculate something that isn't there yet. I am just trying to > join two views appropriately. I might have to employ some > variant of Celko's integer helper table but I'm not sure how > to procee

[SQL] select column by position

2004-09-24 Thread Jennifer Lee
Is there a way to select a column in a table by its position rather than the field name? If I understand correctly column position in a table is fixed. I’ve not been able to find anything in the archives or docs to indicate that it’s possible to select by position.   For example:   CREA

[SQL] INDEX problem

2004-09-24 Thread Vladimir S. Tikhonjuk
Hi all! I have such table: CREATE TABLE object ( id SERIAL, object_type_id int8 ); This table has 4 000 000 rows. There are 2 index: CREATE INDEX object_id_idx ON object(id); CREATE INDEX object_object_type_id_idx ON object(object_type_id); So: # EXPLAIN SELECT * FROM object WHERE id =

Re: [SQL] [GENERAL] need ``row number``

2004-09-24 Thread Karsten Hilbert
> You are going to need a set returning function. It will have > to look up the expected boosters, the expected time elapsed, > and return them with their sequence numbers if they exists. > There is no easy way to do it in a view that I can think of. I am not convinced I'll need a SRF. I am not try