On Wednesday 10 July 2002 23:04, David Durst wrote:
> I am not sure what the end select does, so if you can give me a explination
> it would be apreciated
It is there to satisfy the requirement that the function should return
a value from a select statement:
"12.2. Query Language (SQL) Functions
David Durst wrote:
> I was wondering if there was a way of returning a complete row from a
> function, in reading the documentation of CREATE FUNCTION. I was under the
> impression that you could return a row by using setof, but this does not
> seem to be true.
> Can anyone help?
The short answer
Stephan,
> Thanks. Thought it was something like that.
>
> Thank you guys, though, OVERLAPS is asymmetric.
Err ... I meant "symmetric".
--
-Josh Berkus
Aglio Database Solutions
San Francisco
---(end of broadcast)---
TIP 6: Have you searche
Jie Liang wrote:
> Thanks!
> But I did not make long form works also, is it:
> pg_restore --index="\"indexname\"" --dbname=mydb mydumpfile
> ???
> msg:
> pg_restore:[archiver] could open input file: No such file or directory
Strange. I found a few more problems with the getopt values in
Dirk Lutzebaeck wrote:
>
> Hello,
>
> when using LIMIT/OFFSET is it possible to get also the total number of rows
> besides the actual number of rows of the select? It should be there
> because the whole list is ordered anyhow. I'm using 7.2.1.
No way to do that. Perhaps a CURSOR and look at t
I was wondering if there was a way of returning a complete row from a
function, in reading the documentation of CREATE FUNCTION. I was under the
impression that you could return a row by using setof, but this does not
seem to be true.
Can anyone help?
---(end of broadcas
Stephan,
> Spec thing.
>
> In SQL92,
> "X BETWEEN Y AND Z" is equivalent to "X>=Y AND X<=Z".
>
> In SQL99, there's BETWEEN SYMMETRIC and ASYMMETRIC, but ASYMMETRIC is the
> default which is the same as the SQL92 version afaics. Symmetric is an
> optional feature that I think Christopher's been
On Wednesday 10 July 2002 21:59, David Durst wrote:
> Is there anyway to create a insert function?
> I am trying:
> CREATE FUNCTION add_user(varchar(20),varchar(20),varchar(20),int4,int4)
> RETURNS int4 AS 'INSERT INTO usr
> (user_name,first_name,last_name,permission_set_id,customer_id) values
> (
On Wed, 10 Jul 2002, Josh Berkus wrote:
> Folks,
>
> Why does BETWEEN only work for ascending criteria? For example:
>
> jwnet=> select '2002-06-07'::TIMESTAMP BETWEEN '2002-06-29'::TIMESTAMP and
> '2002-06-01'::TIMESTAMP;
> ?column?
> --
> f
> (1 row)
>
> jwnet=> select '2002-06-07':
Is there anyway to create a insert function?
I am trying:
CREATE FUNCTION add_user(varchar(20),varchar(20),varchar(20),int4,int4)
RETURNS int4 AS 'INSERT INTO usr
(user_name,first_name,last_name,permission_set_id,customer_id) values
($1,$2,$3,$4,$5)' language 'sql';
and get:
ERROR: function dec
Folks,
Why does BETWEEN only work for ascending criteria? For example:
jwnet=> select '2002-06-07'::TIMESTAMP BETWEEN '2002-06-29'::TIMESTAMP and
'2002-06-01'::TIMESTAMP;
?column?
--
f
(1 row)
jwnet=> select '2002-06-07'::TIMESTAMP BETWEEN '2002-06-01'::TIMESTAMP and
'2002-06-29'::
Thanks!
But I did not make long form works also, is it:
pg_restore --index="\"indexname\"" --dbname=mydb mydumpfile
???
msg:
pg_restore:[archiver] could open input file: No such file or directory
could you give out a example of long form
Thanks again.
Jie Liang
-Original Mes
JGM wrote:
>
> Could it be true??
>
> I've a table with < 46000 rows. And a little Update like
>
> UPDATE foo set xxx = 'X';
>
> needs about 15 seconds???
>
> What's wrong?
How long since you vacuumed that table? How big are the rows? Are there
triggers, constraints, anything fancy? How many
PostgreSQL does not know how to sort 'TEST'.
You must help it be telling it what tpe it is.
Add ::text after 'TEST' as in 'TEST'::text.
Maybe PostgreSQL should default to text for unknown types...
JLL
Andreas Schlegel wrote:
>
> Hi,
>
> I need some help to let this sql statement run with Po
Richard Huxton <[EMAIL PROTECTED]> writes:
> Does anyone know what type a quoted literal has?
It's assigned the placeholder type UNKNOWN until the parser can figure
out from context what type it should be. Unfortunately in this case
there's no context the parser knows how to work with.
> It doe
On Wednesday 10 Jul 2002 1:25 pm, Achilleus Mantzios wrote:
> On Wed, 10 Jul 2002, Andreas Schlegel wrote:
> > select DISTINCT tnr, titel, 'TEST' AS testcol from tTitel;
> > ERROR: Unable to identify an ordering operator '<' for type 'unknown'
> > Use an explicit ordering operator or mo
"Ian Cass" <[EMAIL PROTECTED]> writes:
> I've got a function that I run as a trigger to update a summary table on
> insert to the main table. As you can see below, it does a select & an INSERT
> if not found, or an UPDATE if found. This currently works OK, but I'd like
> to improve performance by
On Wed, 10 Jul 2002, Andreas Schlegel wrote:
> Hi,
>
> I need some help to let this sql statement run with Postgres 7.2.1
>
> Doesn't work:
> select DISTINCT tnr, titel, 'TEST' AS testcol from tTitel;
> ERROR: Unable to identify an ordering operator '<' for type 'unknown'
> Use an exp
Hello,
when using LIMIT/OFFSET is it possible to get also the total number of rows
besides the actual number of rows of the select? It should be there
because the whole list is ordered anyhow. I'm using 7.2.1.
Thanks for help,
Dirk
---(end of broadcast)--
There're no another ways? It don't looks like optimal.
Petr Jezek
- Original Message -
From: "Jean-Luc Lachance" <[EMAIL PROTECTED]>
To: "Roy Souther" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, July 08, 2002 5:22 PM
Subject: Re: [SQL] Bad SUM result
> That is because your
Hi,
I need some help to let this sql statement run with Postgres 7.2.1
Doesn't work:
select DISTINCT tnr, titel, 'TEST' AS testcol from tTitel;
ERROR: Unable to identify an ordering operator '<' for type 'unknown'
Use an explicit ordering operator or modify the query
If I remove the D
>
> I'm trying to declare a variable in PostgreSQL, so I can save some values in
> it. After, I want to calculate with this variable.
> For example:
>
> declare vp integer;
> select price into :vp from article where anr = 1;
> vp := vp + 1;
> update article set price = :vp where anr = 1;
AFAIK,
>
> I would like to know if there are any global variables
> storing the error code or the number of rows affected
> after each execution of the SQL statement.
You did not mention which interface you are using.
In C there are functions available like
extern const char *PQcmdTuples(PGresult *r
Hi,
I've got a function that I run as a trigger to update a summary table on
insert to the main table. As you can see below, it does a select & an INSERT
if not found, or an UPDATE if found. This currently works OK, but I'd like
to improve performance by removing the SELECT & attempting an UPDATE
Le Mercredi 10 Juillet 2002 10:34, q a écrit :
> Is there anyway we can track queries entered?
> Is there a table that stores all the actions that a user entered? (history)
> Is there such a feature?
>
For both of your problems, see the way you can launch the postmaster.
For example, I use to laun
Is there anyway we can track queries entered?
Is there a table that stores all the actions that a user entered? (history)
Is there such a feature?
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster
26 matches
Mail list logo