Folks,
Where do I send bug reports for 7.1 beta? I;'ve looked on the web
site, and don't see an address or bugtraq forum.
-Josh Berkus
--
__AGLIO DATABASE SOLUTIONS___
ral
functions ... my search routines will be hard to run without
it. Perhaps you could turn off EXECUTE by default, but
allow it as a compile-time option for those of us wise
enough to understand the dangers?
-Josh Berkus
__AGLIO DATABASE SOLUTIONS___
Complete inform
.
-Josh Berkus
--
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete information technology [EMAIL PROTECTED]
and data management solutions (415) 565-7293
for law firms, small businesses
edule projects, I'd offer to
write this up for the User's Manual. Actually, consider that a
medium-term commitment ... before the end of the year, I'll write a much
longer PL/pgSQL chapter which Jan can review & correct. (I think I'm in
a postion to do so, as the curren
er. You can't get that by scanning an index
> that has both columns in the same order...
Aha. I see the problem. My approach would be to use two seperate
indexes, but maybe that's not sophisticated enough :-)
And, Tom, you're working too hard again. It's Saturday. Go home.
way around this? Maybe something using
the RECORD data type? Can anyone help me with an
explanation of the RECORD data type and how to get data into
and out of it?
-Josh Berkus
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Compl
bjtbl, et, event,
> time, reason,
> owner) values ('' || $2 || '', '' || $3 || '', '' || $4
|| '', '' || $5 || '', current_timestamp, '' || $6 || '',
'' || $7 || '
t; Just thought the built in procedure implmentation would be quite mature
> by now.
Implementation is in its adolescence/young adulthood. Documentation is
still in its early childhood. We (the user base) will fix that, but not
this month.
-Josh Berkus
--
__AGLIO DATA
tell me where to search) the developer notes on
what improvements have been made in the function parser so that I can
take advantage of them?
-Josh Berkus
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete information technology
a way to insert
queries into temporary tables.
For better results, check out Jan's syntax for FOR ... EXECUTE in his
last post.
-Josh Berkus
--
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete information technolo
o so. I would also suggest that you
review your data architecture and see if it's really necessary for you
to store your data in two seperate databases.
-Josh Berkus
--
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complet
InsertTime field is not open to user input, why are you providing
users with a data-entry interface for this field at all? Why not hide
it, or display it read-only?
-Josh Berkus
--
__AGLIO DATABASE SOLUTIONS___
e DB
engine doesn't know how you want to format the date. Instead, use the
to_char builtin function, as defined in the docs:
http://www.postgresql.org/users-lounge/docs/7.0/postgres/functions2976.htm
Share & Enjoy!
-Josh Berkus
--
__AGLIO DATABASE SOLUTIONS___
David,
> However this gives me output that I don't know how to read: '7 02:34:27'
> Does that read as 7 Days, 2 Hours, 34 Minutes and 27 seconds?
Yes.
-Josh Berkus
--
__AGLIO DATABASE SOLUTIONS___
Jo
ected SELECT query in exec_stmt_execsql()
Help?
-Josh Berkus
--
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete information technology [EMAIL PROTECTED]
and data manag
Tom, Stephan,
> Josh Berkus <[EMAIL PROTECTED]> writes:
> > ERROR: unexpected SELECT query in exec_stmt_execsql()
>
> plpgsql doesn't think you should execute bare SELECTs, only SELECT INTO.
That would explain it. I have a nested function call in the form:
SELEC
or Mere Mortals")
before proceeding any further, or you'll end up spending the next year
paying for what you don't understand now.
-Josh Berkus
--
__AGLIO DATABASE SOLUTIONS___
in the current
development version. Please browse the archives (about 1-2
months ago) for my suggested workaround for the time being.
-Josh Berkus
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete information technology
u would probably be better off in
several regards constructing a specific function to fill that purpose
(lf_lookup_student_id(VARCHAR)). Personally, I'm a function "junkie" an
I've never had need to replicate the VBA Dlookup functionality.
-Josh Berkus
--
__AGLIO DATA
is 7.1 expected to be out of beta?
-Josh Berkus
P.S. Let me suggest again that you let us application developer-types
field the newbie questions so that you can focus on the hard issues and
developing the database engine.
--
__AGLIO DATABASE
field2 = variable2,
field3 = variable3
WHERE primarykey = primarykey_variable;
END IF;
-Josh Berkus
--
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete information technology [EMAIL PROTECTED]
inners"(Osborne), "Linux
Administration"(O'Reilly) and "Linux in a Nutshell" (O'Reilly). And I
still hire specialists for complex networking.
Good Luck!
-Josh Berkus
__AGLIO DATABASE SOLUTIONS___
; if the results are NULL, do an insert. If your table has few
fields (<15) you can even do this through a function, passing the field
values as parameters of the function.
-Josh Berkus
--
__AGLIO DATABASE SOLUTIONS___
nt to consider editing your next edition to include the
above modification. WHERE ... NOT IN is a bad idea for any subselect on
medium-large tables.
-Josh Berkus
--
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete informat
. Futher, in a low-transaction situation, the searches table
may be used for all searches in the DB on tables with INT4 primary keys.
-Josh Berkus
--
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete information technolog
splay?
-Josh Berkus
--
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete information technology [EMAIL PROTECTED]
and data management solutions (415) 565-7293
for law firms, small busin
array_loop] LOOP
array_loop = array_loop + 1;
END LOOP;
array_loop := array_loop - 1
RETURN array_loop;
END;'
LANGUAGE 'plpgsql';
-Josh
--
__AGLIO DATABASE SOLUTIONS__
I'll post the PLPGSQL function to the list after I write it.
-Josh Berkus
--
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete information technology [EMAIL PROTECTED]
and data
something that isn't strictly a SQL
question, but I'm not sure where else to ask.
-Josh Berkus
P.S. If somebody wants consulting $$$ for the above, it may be
available.
--
__AGLIO DATABASE SOLUTIONS_
s over budget and behind
schedule already.
I'll take a stab at in in PLPGSQL and post the results.
-Josh Berkus
--
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete informati
CT CASE (which we should
call 'SELECT MATCH') statement in PL/pgSQL? Different from the CASE
that allows you to select column values in the SELECT clause, SELECT
MATCH would be an IF ... THEN style structure offering an indefinite
numebr of options. I'm sure that
s that there are actually two
sub-tables with thousands of entries and the procedural approach is
rather slow.
Suggestions?
-Josh Berkus
--
__AGLIO DATABASE SOLUTIONS___
Josh Berku
ither of these options sounds like it would be faster and
more scalable than a simple PL/pgSQL function which loops throught the
names and appends them to a string. Perhaps for Phase II of our project
I'll be able to afford somebody to write a custom aggregat
; AS select o.ra, o.decl, o.mag, o.smag, o.file_id from
> observations o;
-Josh Berkus
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete information technology [EMAIL PROTECTED]
and data management solutions (415)
less you have 2 dozen indexes on the target table.
-Josh Berkus
--
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete information technology [EMAIL PROTECTED]
and data managemen
stead of CREATE TABLE AS.
-Josh Berkus
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete information technology [EMAIL PROTECTED]
and data management solutions (415) 565-7293
for law firms, small businesses
integrity check deferrable (there's a way to
do this, it was discussed a couple weeks ago - ask Tom).
-Josh Berkus
--
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete information technology [EMAIL PROTECTED
David,
Please post your tabledefs and the full query definition. Aside from
the need for an explicit typecast (i.e. '2000-03-02'::date) and the lack
of clarity on month vs. day (March 2 or February 3?), seeing the whole
picture would help.
-Josh Berkus
__AGLI
ou should be aware that the pgODBC driver for Win32 clients does
not recognize PostgreSQL sequences correctly when called as default
vaues for other than a SERIAL field (i.e. if you use the DEFAULT
NEXTVAL('sequence') construction rather than the SERIAL type, pgODBC
will error out on IN
and even:
level_array MONEY[100];
Please help!
-Josh Berkus
--
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete information technology [EMAIL PROTECTED]
and data management solutions (415) 565-7293
WHERE group_artifact_id=new.group_artifact_id;
END IF;
END IF;
END IF;
END IF;
END IF;
RETURN NEW;
END;
-Josh
--
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete informa
Tom, Bruce,
Is there any way to make use of the contents of a cursor in a PL/pgSQL
function? FETCH ... INTO isn't supported, according to the docs. Can I
use the dot notation, or something similar?
-Josh
--
__AGLIO DAT
IN as above into the query for each value in your array.
This method is a lot of work for both you and the server. Why do you
think that MS Access often crashes on a large "crosstab" query?
-Josh Berkus
__AGLIO DATABASE SOLUTIONS___
r samples for PLpgsql except USER GUIDE and
> PostgreSQL Introduction & concept?
No. Some of us user-types are working on expanded documentation; until
then, you'll just have to muddle through.
-Josh Berkus
--
__AGLIO DATABASE SOLUTIONS___
e was
> quite surprised that it worked, so no guarantees about long-term suitability.
Hmmm ... this feature is very, very, useful now that I know how to use
it. I'd love to see it hang around for future versions of PgSQL. Tom?
-Josh Berkus
--
______AGLIO DATABASE SOLUTIONS___
this
> in depth?
Yup. http://www.databasedebunking.com/ Dig through the archives.
-Josh Berkus
--
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete information technology [EMAIL PROTECTED]
and data management s
tables, depending on user configuration. The wonderful
PostgreSQL sequence handler makes this possible. Thanks, Tom & team!
I've done this with a couple of other tables. Not relationally correct,
but I can't find anything wrong with the idea.
> Couldn't find the server... I w
that's working perfectly but
I'll keep you posted.
> If
> you
> were joining words in a sentence, obviously it would matter (unless
> you
> were on usenet ;-)
illiterate posters newsgroup most calling you are?
-Josh Berkus
__AGLIO DATABASE SOLUTIONS___
Hey, why do you think that I was bugging you about 7.1 for months? You
should see some of the things I do with sub-selects. Err ...
programming-wise, that is ;-)
Speaking of which, when's the 7.1 release?
-Josh
__AGLIO DATABASE SOLUTIONS_
NULL was the pattern. Is this a bug?
-Josh Berkus
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete information technology [EMAIL PROTECTED]
and data management solutions (415) 565-7293
for law firms, small
ETURN return_value;
END;
-Josh
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete information technology [EMAIL PROTECTED]
and data management solutions (415) 565-7293
for law firms, small businessesfax 62
n &
view decarations to a text file? I'm using pgaccess mostly for
development, but it doesn' let me cut-and-paste.
-Josh Berkus
---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-noma
ds like what I'm seeing! And now that you point it out, there
is a bug in the PHP that calls this function that passes an empty string
('') instead of a NULL. Thanks!
Any possibility that that error message could be made more informative?
(i.e. ERROR: regcomp failed due to e
Tom,
> You're right, this isn't a very transparent message. Perhaps
>
> ERROR: Invalid regular expression (empty expression or
> subexpression)
>
> Comments, better wordings?
Nope. That's great.
-Josh Berkus
__AGLIO DATABASE SOL
ble
Am I on the right track?
-Josh
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete information technology [EMAIL PROTECTED]
and data management solutions (415) 565-7293
for law firms, small business
that.
I'm interested in the approach for another reason. I have a number of
tables that must match a NON-UNIQUE value in a reference table, and thus
I'd like to test them against a query or view.
-Josh Berkus
__AGLIO DATABASE SOLUTIONS___
d not u.b
and a.status = 3);
-Josh Berkus
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete information technology [EMAIL PROTECTED]
and data management solutions (415) 565-7293
for law firms, small b
, reuslting in a still-inflated (and sometimes varying!)
COUNT. It won't work properly in T-SQL or MS Office SQL, for example.
-Josh Berkus
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete information technology
7.0.
I can think of several ways to do this, but they all depend on what
display results you're trying to get. Perhaps you could post some
simplified tabledefs, and the result you want to see?
-Josh Berkus
__AGLIO DATABASE SOLUTIONS___
generates a temporary table,
and has to run once for every row in your result set. I'll post code
later if nobody comes up with a better solution.
If you knew all of your categories in advance, you could do this via an
annoying UNION statement. I'm assuming
out SQL Server 2000).
Now, Tom, at what point do character values begin to be stored "outside
the table"? This is something I want to avoid, having had some bad
experiences with pointers and DB corruption (although not with PGSQL).
-Josh Berkus
__AGLIO DATABASE SOLUTIO
to text so that I could have a copy of the final version. To my
horror, the function was GONE from the system catalog (pg_proc). I have
not run VACUUM on the database anytime recently ... is there any
possibility that my function is still present as a "deleted" row?
-Josh Berkus
on body, which is
> probably all that you really need. But if it's more than a couple K
> then the text will be compressed and difficult to spot or extract.
Can you explain that? I think that the text may be short entough to be
uncompressed.
-Josh Berkus
_
reat Bridge, who is now maintaining them.
Look in their Projects area.
-Josh Berkus
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete information technology [EMAIL PROTECTED]
and data management solutions
e ID
fields in lower case (one that isn't foriegn keyed, of course).
2. It's possible that defining these rows as type OID requires some
special reference syntax. If so, hopefully someone on the list will
come forward.
-Josh Berkus
__AGLIO DATABASE SOLUTIONS
ck to the "regular" behavior of
sum(integer) = integer?
-Josh Berkus
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete information technology [EMAIL PROTECTED]
and data management solutions (415) 565-7293
for
;
PERFORM Function2;
SELECT current_timestamp;
etc ...
COMMIT WORK;
If the test script bogs down as well, you have your answer although the
workaround may be tricky to implement.
-Josh Berkus
__AGLIO DATABASE SOLUTIONS___
Josh
r than a SQL problem.
-Josh
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete information technology [EMAIL PROTECTED]
and data management solutions (415) 565-7293
for law firms, small businessesfax
Tom,
That does bring up a related question: when are we gonna get DROP
COLUMN capability? Currently my tables are littered with unused columns
because I can't remove them without blowing my referential integrity and
views to heck.
-Josh B
ON query were a subselect.
Coming from a SQL Server background, I'd actually find the suggested
behavior rather confusing (as well as tough for you guys to implement).
-Josh
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
e talking about features for version 7.3
or later ... a direct way to approach it would be to do a push-down on
simple UNION views, and to do output filtering on UNION views wich
contain a CASE, any subselect, or CAST expression (or similar) on the
filtered columns.
-Josh
__AG
#x27;''' || s_client || '''';
-Josh Berkus
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete information technology [EMAIL PROTECTED]
and data managemen
fixed the problem, but I'd love to know
what's going on here.
-Josh Berkus
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete information technology [EMAIL PR
> '''' THEN
where_string := where_string || '' AND order_contact ~* '''''''' ||
v_contact
|| '''''';
END IF;
IF trim(v_temps) <> '''' THEN
d not work. It seems like there should
be some way to access this internal row count.
-Josh
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete information technology [EMAIL PROT
lts, and may be
overridden by a specific insert. Thus:
1. Create the id field as type SERIAL.
2. Insert your records into the new table, including the ID value.
3. Crank up the SERIAL sequence to the number of the highest ID present:
SELECT SETVAL('
state you difficulty, and I can probably help you.
-Josh Berkus
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete information technology [EMAIL PROTECTED]
and data management solutions (415) 565-7293
for law
> -- If YES then return the error
> if login_check <> '''' then
> return ''That login already exists for user '' || login_check
|| ''. Please choose another.'';
> end if;
(assuming that first_name and
overlap_amount := end1 - begin1;
ELSE
overlap_amount := end2 - begin1;
END IF;
END IF;
RETURN overlap_amount;
END;'
LANGUAGE 'plpgsql';
-Josh Berkus
__AG
treated as a Boolean value, and used for
testing and comparison without and "= TRUE" or "= FALSE". What's going
on here?
-Josh
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete information technol
END LOOP;
END IF;
(NOTE: OFFSET will not accept any math if set dynamically {as above}.
Thus, "LIMIT 1 OFFSET insert_loop + 1" will error).
-Josh
--
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Compl
Kris,
> I am writing a function in postgresql which inserts a row into the
> database,
> but it is not working, can anybody help me out with a simple example.
Please post your function. I'm sure the folks can take a crack at it.
-Josh
__
g in
a Boolean fashion, I took them apart and re-built them ... and it turned
out to be a data problem in a linked table (a unique index was dropped
somehow without my awareness while altering the tables).
So Booleans are working properly, and you can relax now.
-Josh Berkus
__
to make all of my BOOLEAN columns NOT NULL
DEFAULT FALSE.
-Josh
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete information technology [EMAIL PROTECTED]
and data management solutions (415) 565-7293
for law firms,
ur procedures over directly.
Full stored procedures are planned for Postgres, but not for a couple of
versions.
-Josh Berkus
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete information technology [EMAIL PROTECTED]
a
rtion;
END;
3. Then set the id column to default to this new function.
This would give you (after you correct my mistakes) a number, the first
X digits of are Serial, and the last 2 digits based on the server's
internal clock. Thus, the numbers would *not* be sequential, and would
appe
ch row from the temporary
> table, do some processing and insert into actual tables. Any idea how
> i
> can accomplish this???
Yes. Please see my post from last week called: "Re: [SQL] Calling plSQL
functions".
-Josh Berkus
__AGLIO DATABASE SOLUTI
their activites.
4. Stored procedures should have access to the full range of DB control
language, includign cursors, transactions, and error handling.
Of the 4. I'm only certain that 1. is part of the SQL92 spec. Any more
authoritative opinions?
-Josh
__AGLIO DATABASE SOLU
Folks,
Not to be a list-nazi or anything, but can we move this discussion to
the PHP list? These issues are already part of the PHP list archives.
If anyone is interested in Postgres-PHP topics, the PHP list is still
quite low-traffic.
-Josh Berkus
---(end of
roach:
CREATE VIEW c_aggregate AS
SELECT sum(a) as sum_a, b FROM c GROUP BY b;
SELECT max(sum_a) FROM c_aggregate;
Not as fast or dynamic as a subselect, but should solve your immediate
problem.
-Josh Berkus
__AGLIO DATABASE SOLUTIONS__
Nusa,
I suggest that you take your question to the pgsql-jdbc list, a list
specifically for JDBC interfacing with Postgres. See www.postgresql.org
for directions on how to subscribe.
-Josh
__AGLIO DATABASE
go back and add data
validation and RAISE ERROR statements to all of my functions that do
INSERTS or UPDATES to tables with referential integrity triggers. Is
there a way around this?
2. Is there a plan to fix this kind of deficiency in Postgres
function/procedure error handling?
Thanks so m
eral other ways I can check, as well. However, I was hoping
for some way to avoid adding anything to a couple of dozen functions
which are already debugged.
-Josh
P.S. Does anyone yet have full documentation on GET DIAGNOSICS?
Roberto?
__AGLIO DATABASE SOLUTIONS___
orders
> regression=#
Always good to have you folks test something. This does appear to be a
bug ... in KPSQL (the KDE GUI for PSQL), not in Postgres. When I run it
through command-line PSQL, an error is returned; for some reason, KPSQL
returns the return value for the function and no e
iled RC2. I keep meaning to take it up with PGSQL
Inc. but not getting around to it ...
-Josh Berkus
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete information technology [EMAIL PROTECTED]
and data management solution
d be hardware problems. Have you tried doing a
full sector-by-sector scan on that HDD, or better yet, moving the whole
database to an alternate server?
BTW, I run Postgres on top of ReiserFS, which cuts down my disk errors
significantly.
-Josh
__AGLIO DATABASE SOL
e function handler won't let me create, then delete
the same record. What goes on?
-Josh Berkus
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete information technology [EMAIL PROTECTED]
and data management solut
a) do something
other than deleting the records, or b) drop the referential integrity
check on the table?
-Josh
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete information techno
Mark,
I'd love to help you with your PL/pgSQL function, but since I don't
read Perl, I can't tell what you're trying to do. Can you spell it out
more explicitly?
-Josh
__AGLIO DATABASE SOLUTIONS___
e in
query."
Now, I can (and have) re-phrase the query so that PostgreSQL will
accept it. However, I was under the impression that the above was
standard SQL92. Am I mistaken? Or is this form something that just
hasn't been implemented yet?
101 - 200 of 864 matches
Mail list logo