Hello Tom,
The example you have given is EXACTLY why something like CURRENT is needed to limit the number of
unique queries or prepared statements. (or to do a selection of all values before an update meaning
two executed queries.)
regards,.
Dennis
On 04/18/2012 06:24 PM, Tom Lane wrote
rs with CURRENT when the query is executed. Note
the added WHERE clause? The parameter for id is always on the same index. This makes the bookkeeping
a lot easier and should reduce the need for generating UPDATE queries or even client JDBC code.
-- Dennis Verbeek
--
Sent via pgsql-sql mailing lis
Dear Ben
thanks for you anwser.
I try to add function quote_literal on my sql statement .
but it raise other error message (quote_literal not support bytea format):
function quote_literal(bytea) does not exist
Ben Morrow 提到:
Quoth dennis :
Hi Ben
here is my function , it'
Postgres : 8.1.4
Dennis
Ben Morrow wrote:
Quoth dennis:
Dear Ben
thanks for you anwser.
I try to add function quote_literal on my sql statement .
but it raise other error message (quote_literal not support bytea format):
function quote_literal(bytea) does not exist
Which
_chunk_table_usersessiontable();
result:
NOTICE: /* NUM:42883, DETAILS:operator does not exist: text || bytea */
<<<<
NOTICE: select * from usersessiontable order by sessionid limit 1 offset 1
check_missing_chunk_table_usersessiontable
here is example
table name is "mail":
column| type
-
sender|char
subject |char
content |bytea
I want copy some record into new table 'mail_new'.
sql:
create table mail_new as select * from mail sender='dennis'
result has an
fiers instead of lower casing them as pg
do. The sql standard say that they should be upper cased. But as far as
I know there are no plan at the moment to add such an option either.
Some time in the future I expect it to be implemented only because it's
the standard.
/Dennis
R int);
INSERT INTO foo VALUES (42);
SELECT BaR, bar, BAR, "bar" FROM foo;
But using "Bar" wont work.
/Dennis
---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq
imited text
to be indexed & searched.
Dennis Sacks
[EMAIL PROTECTED]
filesystem (which is what filesystems are designed for) and store the
metadata in the database.
Dennis Sacks
[EMAIL PROTECTED]
---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command
Bruno Wolff III wrote:
On Tue, Jan 25, 2005 at 21:21:08 -0700,
Dennis Sacks <[EMAIL PROTECTED]> wrote:
One of the things you'll want to do regularly is run a "vacuum analyze".
You can read up on this in the postgresql docs. This is essential to the
indexes being use
you'll want to run vacuum analyze.
Dennis Sacks
[EMAIL PROTECTED]
ting from TSQL to
PL/pgSQL, but then I've not looked for any. They may exist.
Best of luck,
Dennis Sacks
[EMAIL PROTECTED]
may need to be rewritten if they use the Oracle syntax for outer
joins. Also the NVL function can be replaced with coalesce and DECODE
will need to be rewritten with CASE.
SYSDATE can be replaced with NOW()
Also check out this doc for more hints:
http://www-2.cs.cmu.edu/~pmerson/docs/OracleToPost
or those of us porting
from Oracle.
Dennis
[EMAIL PROTECTED]
---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
sense in plpgsql? Does it make sense to do a commit in
plpgsql?
Thanks,
Dennis
---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match
in plpgsql? Does it make sense to do a commit in
plpgsql?
Thanks,
Dennis
---(end of broadcast)---
TIP 8: explain analyze is your friend
Dennis writes:
What are your thoughts on the best way to approach this? Break up the
stored proc into ten different stored procs that return ref cursors?
I guess another question here is whether I can return a row type or record
type with (integer, varchar, refcursor) and then make use of the
approach this? Break up the stored
proc into ten different stored procs that return ref cursors?
Thanks,
Dennis
dennis at calico dash consulting dot com
---(end of broadcast)---
TIP 6: Have you searched our list archives?
http
Bruce Momjian writes:
There is an FAQ item on this --- use EXECUTE.
So I should be using EXECUTE for all access to the temp tables? ie inserts,
and selects (in this case). Should I use execute for the table creation?
Dennis
---(end of broadcast
the transaction ends?
I'm not explicitly referencing pg_temp_8 in my stored function.
Can someone explain what is going on? Have I given enough information?
dennis
pg-user at calico dash consulting dot com
---(end of broadcast)---
TIP 9: the
Joe Conway writes:
dennis'# pParsed varchar[];
Make that last line:
pParsed varchar[] := ''{}'';
That initializes pParsed to an *empty* array. Otherwise pParsed is NULL,
and when you attempt to extend a NU
Tom Lane writes:
"Dennis" <[EMAIL PROTECTED]> writes:
I am trying to return an array from a function and don't seem to be having
luck.
Seems to work for me ... what PG version are you using?
pg 7.4.1
I should have listed the source for the function. Here is a simplified
par
'm not sure if that is still the case or if I am
doing something wrong.
Do I need to go with returning a set instead?
Dennis S
[EMAIL PROTECTED]
---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings
t is documented?
Also, I am not getting the results I think I should be getting. Is there any
kind of debug setting, or if not that, a way to output text (i.e. printf)
from plpgsql?
Thanks,
Dennis
[EMAIL PROTECTED]
---(end of broadcast)---
TIP 4:
Hello,
I am wondering if I can use a cursor in a for loop. I haven't been able to
get it to work. I am just beginning plpgsql and I am struggling here.
I am trying to do this:
create or replace function ttest(varchar)
RETURNS varchar AS '
DECLARE
parId ALIAS FOR $1;
denn
n for example do
dennis=# SELECT encode (digest ('the string', 'md5'), 'hex');
44d5a3f30f0328e0cf60cd275ed3aac9
--
/Dennis
---(end of broadcast)---
TIP 6: Have you searched our list archives?
http://archives.postgresql.org
Marek Lewczuk wrote:
Hello,
I think that there is a bug in plPGSQL - or maybe I don't know something
about this language. Try to create this function
Ok., this is the function created in plPGSQL:
CREATE FUNCTION "public"."test" (text, text) RETURNS text AS'
BEGIN
IF $1 THEN
RETURN $1;
ELSE
sql.org/docs/7.3/static/datatype.html#DATATYPE-SERIAL
then you can do
insert into table_name (field_name) values (DEFAULT);
--
/Dennis
---(end of broadcast)---
TIP 8: explain analyze is your friend
aps, but it doesn't hurt to know that it works
as intended here.
--
/Dennis
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
dren.id_father = r.id_father
and children.min = r.min;
--
/Dennis
---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
from tracks,albums
where tracks.DISCID = albums.DISCID
group by tracks.DISCID
);
What is the correct way of selecting the album?
--
Dennis K.
~.. It is impossible to make anything foolproof,
.>>. because fools are so ingenious -Roger Berg-
|\
--
ntial integrity
violation??
ie: ERROR: fk_col1 referential integrity violation - key referenced from B
not found in A.
Is there a way to make this type of constraint work with the update?
If not, is there a way to create a constraint so that col1 != col2 is
inforced?
Thanks in advance..
D
If I have table A, which contains a primary key,
and table B which inherits from A.
How can I Create a Foreign Key on table C that references A, but will
also pass if a record in inserted in to B.
for instance:
create table A
(
prim_key char(20) not null primary key
);
create table B
34 matches
Mail list logo