Gregory Stark <[EMAIL PROTECTED]> writes:
> I haven't quite figured out how this is useful though. It probably makes more
> sense if you use plpgsql but I still don't quite see what the use case is.
IIRC, the case that actually convinced people to allow it was dblink.
You want to be able to do som
I am trying to record the following entries into a table. I'm curious
to know if there's an efficient/effective way of doing this? This
entries come from an ancient datalogger (note: separated by space and
uses YY/MM/DD format to record date)
Plain file sample.dat
3665 OK BS 07/08/1
--- Alvaro Herrera <[EMAIL PROTECTED]> wrote:
> Any function declared as returning SETOF RECORD needs it, when you don't
> use OUT params. Before OUT params existed, it was the only way to use
> those functions.
Thanks everyone for the exposition! It makes sense.
Regards,
Richard Broersma Jr.
Gregory Stark wrote:
> "Michael Glaesemann" <[EMAIL PROTECTED]> writes:
>
> > ERROR: a column definition list is only allowed for functions returning
> > "record"
> >
> > So the *form* is right, but I don't know of an example that works.
>
> postgres=# create function testf() returns record as
On 8/21/07, Gregory Stark <[EMAIL PROTECTED]> wrote:
> "Michael Glaesemann" <[EMAIL PROTECTED]> writes:
>
> > ERROR: a column definition list is only allowed for functions returning
> > "record"
> >
> > So the *form* is right, but I don't know of an example that works.
>
> postgres=# create funct
"Michael Glaesemann" <[EMAIL PROTECTED]> writes:
> ERROR: a column definition list is only allowed for functions returning
> "record"
>
> So the *form* is right, but I don't know of an example that works.
postgres=# create function testf() returns record as 'select 1' language sql;
CREATE FUNCT
On Aug 21, 2007, at 18:04 , Michael Glaesemann wrote:
So the *form* is right, but I don't know of an example that works.
CREATE TABLE foos
(
foo text PRIMARY KEY
, title text NOT NULL
);
INSERT INTO foos (foo, title) values
('foo', 'the great')
, ('bar', 'the extravagant')
, ('baz',
On Aug 21, 2007, at 14:34 , Richard Broersma Jr wrote:
Can any one give an example of the difference between a
column_alias and a column_definition when
using a function in the FROM clause?
from the manual:
http://www.postgresql.org/docs/8.2/interactive/sql-select.html
"function_name ( [ ar
On 8/21/07, Jon Collette <[EMAIL PROTECTED]> wrote:
> I think this will work for what I need. I have been messing around with
> this using select into
>
> /select True as donothing into temporary table table_trigger_name;
> then run statement that I want to be ignored
> /
> The trigger would have
I think this will work for what I need. I have been messing around with
this using select into
/select True as donothing into temporary table table_trigger_name;
then run statement that I want to be ignored
/
The trigger would have a select upon the table_trigger_name to determine
if it should
Good Idea. However some of my triggers use the DELETE action as well.
So I can't use this method.
Thomas Kellerer wrote:
Jon Collette wrote on 21.08.2007 23:26:
Is it possible to run an insert,update, or delete and have it not
launch a trigger like it normally would?
For example could I se
Jon Collette wrote on 21.08.2007 23:26:
Is it possible to run an insert,update, or delete and have it not launch
a trigger like it normally would?
For example could I set a value
DONOTRUN = True;
insert into contacts
Where the trigger on contacts would call a function that would have an
On 8/21/07, Jon Collette <[EMAIL PROTECTED]> wrote:
> Is it possible to run an insert,update, or delete and have it not launch
> a trigger like it normally would?
>
> For example could I set a value
> DONOTRUN = True;
> insert into contacts
The closest thing to a session variable for pgsql is
Thanks for the reply. It looks like this will disable the trigger for
all connections to the database. So if the chance occured that another
connection was using the table at the same time it wouldn't launch the
trigger either? am I wrong? I hope so ;)
Rodrigo De León wrote:
On 8/21/07, Jo
On 8/21/07, Jon Collette <[EMAIL PROTECTED]> wrote:
> Is it possible to run an insert,update, or delete and have it not launch
> a trigger like it normally would?
alter table disable trigger ...
http://www.postgresql.org/docs/8.2/static/sql-altertable.html
---(end of broa
Is it possible to run an insert,update, or delete and have it not launch
a trigger like it normally would?
For example could I set a value
DONOTRUN = True;
insert into contacts
Where the trigger on contacts would call a function that would have an
IF statment for that DONOTRUN value?
Or
On Aug 21, 2007, at 12:48 , [EMAIL PROTECTED] wrote:
SELECT a.x, max(b.x) FROM a, b, c WHERE a.a_id = c.a_id AND b.b_id =
c.b_id GROUP by a.x;
Shouldn't affect performance, but another way to write this which you
may find more readable is to list your join conditions with the joins
rather
Can any one give an example of the difference between a column_alias and a
column_definition when
using a function in the FROM clause?
from the manual:
http://www.postgresql.org/docs/8.2/interactive/sql-select.html
"function_name ( [ argument [, ...] ] ) [ AS ] alias [ ( column_alias [, ...] |
oops...
I meant "DISTINCT ON ( a_id )"
--- Richard Broersma Jr <[EMAIL PROTECTED]> wrote:
> SELECT a.x, b.x
> FROM ( SELECT DISTINCT ON ( a_id ) a_id, b_id
^^
>FROM c ) AS c( a_id, b_id )
> INNER JOIN a
> ON c.a_id = a.id
> INNER J
--- [EMAIL PROTECTED] wrote:
> create table c (
>a_id int,
>b_id int
> );
>
> I am doing a query like this:
>
> SELECT a.x, max(b.x) FROM a, b, c WHERE a.a_id = c.a_id AND b.b_id =
> c.b_id GROUP by a.x;
>
> I only need to get one row from b for each row in a, and it really
> doesn't ma
Hey All,
I have a query I'm trying to speed up, and I was hoping someone could
help me. I have a three tables a and b hold data, and c just references
between a and b:
create table a (
a_id int,
x int
);
create table b (
b_id int,
x int
);
create table c (
a_id int,
b_id int
A. R. Van Hook wrote:
I have a simple (and incorrect queuer) that gives the wrong answer.
Can someone show me the correct syntax?
t
"select sum(s.ref), r.value, s.ref from registry as s
^^^
Simple typo - you've used sum() not count()
qs "select count(*) from registry where ref =3
I have a simple (and incorrect queuer) that gives the wrong answer.
Can someone show me the correct syntax?
t
"select sum(s.ref), r.value, s.ref from registry as s
left join referralkey as r on (s.ref = r.cd)
group by s.ref, r.value order by r.value, s.ref"
sum | value | ref
--+
23 matches
Mail list logo