george young writes:
> I put together a plpgsql function to rename a table and it's indexes
> correspondingly[see below]. I would like to know:
> Is there a more robust/portable/clear way to do this?
> Is this a bad idea for some subtle reason?
It won't work if the table and column names ar
[PostgreSQL 8.1.0 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.0.1]
After tearing out some hair over the following sequence of events:
[a few weeks ago]
alter table foo rename to old_foo;
create table foo();
insert into foo select blahblahblah from old_foo;
[today]
cluster foo_pk
You might find the "DISTINCT ON" syntax does just what you want --- see
the "weather report" example on the SELECT reference page. It's not
standard SQL though.
This works! Thanks!
What would have to be done if I needed a standard SQL solution?
Mark
---(end of bro
Mark Fenbers <[EMAIL PROTECTED]> writes:
> ... However, I only want the first occurrence of a such a series (where the
> event_id is the same), what SQL syntax should I use to do this?
You might find the "DISTINCT ON" syntax does just what you want --- see
the "weather report" example on the SEL
I currently have a working SQL that SELECTs all records whose
'river_stage' column exceeds the 'flood_stage' column. (Very simple --
no applause needed.) Typically, if I get one record, I get a
consecutive series of them since rivers rise and fall in a continuous
fashion, and usually respond
O Emil Rachovsky έγραψε στις Dec 2, 2005 :
>
> I am trying to find out the PostGre equivalent to
> the Sybase function Connection_Property (which returns
> the connection id, given the parameter 'number') ,but
> without success so far. Can anyone tell me how to
> retrieve the connection id in P
I am trying to find out the PostGre equivalent to
the Sybase function Connection_Property (which returns
the connection id, given the parameter 'number') ,but
without success so far. Can anyone tell me how to
retrieve the connection id in PostGre?
Thanks in advance,
Emil