Thank you for your recommendation
I was able to get this to work
(using PG SQL parser to parse out two dimentional PG array
where the array data came from my client program instead of
a DB value)
select ('{{A,B,C},{D,E,F}}'::text[][])[i][j] from
generate_series(1,
On Sun, Aug 16, 2009 at 05:55:08AM -0400, torea...@fastmail.fm wrote:
Thank you for your recommendation
I was able to get this to work
select ('{{A,B,C},{D,E,F}}'::text[][])[i][j] from
generate_series(1, array_upper('{{A,B,C},{D,E,F}}'::text[][], 1)) i
cross join
generate_series(1,
Does anyone know a way to generate a random and unique lowercase
alphanumeric ID (preferably without using 0, 1, o or i to prevent problems
with users manually typing the ID) using SQL without resorting to a
prerendered table or using GUIDs.
For example, if I were to ask for an ID of 5
On 16 Aug 2009, at 4:24, Madison Kelly wrote:
Hi all,
...
CREATE FUNCTION history_radical() RETURNS trigger
AS $$
DECLARE
hist_radical RECORD;
BEGIN
SELECT INTO hist_radical * FROM public.radical WHERE
rad_id=new.rad_id;
I assume you mean to
On Sun, Aug 16, 2009 at 12:07:27PM +0100, Thom Brown wrote:
Does anyone know a way to generate a random and unique lowercase
alphanumeric ID
If you want it to be unique then it's not going to be random. The
easiest way to keep it from producing duplicates is to have some
monotonically
The following is the obvious PGSQL code, you'd obviously need something
else to stop duplicates.
SELECT array_to_string(array((
SELECT SUBSTRING('abcdefghjklmnpqrstuvwxyz23456789'
FROM mod((random()*32)::int, 32)+1 FOR 1)
FROM generate_series(1,5))),'');
As
Hi Madi,
I think you want to use foreign keys which can give you these checks. So
add a foreign key to create a link between rad_id of both tables.
regards,
Bastiaan
Madison Kelly wrote:
Hi all,
I've been using a procedure to make a copy of data in my public
schema into a history schema
On Sun, 16 Aug 2009 12:48:39 +0100
Sam Mason s...@samason.me.uk wrote:
On Sun, Aug 16, 2009 at 12:07:27PM +0100, Thom Brown wrote:
Does anyone know a way to generate a random and unique lowercase
alphanumeric ID
If you want it to be unique then it's not going to be random. The
easiest
On Sun, Aug 16, 2009 at 12:57:34PM +0100, Thom Brown wrote:
SELECT array_to_string(array((
SELECT SUBSTRING('abcdefghjklmnpqrstuvwxyz23456789'
FROM mod((random()*32)::int, 32)+1 FOR 1)
FROM generate_series(1,5))),'');
I've just had a look and PG does actually
Hi all
I have some idea/feature request.
Now, there are several devices available, that can be called rapid seek
devices (RSD in future text). I mean SSD disks, some devices like
gigabyte I-RAM and other (semi)profesional ram disk like solutions for
example Acard ANS-9010 . Rapid seek
Alban Hertroys wrote:
On 16 Aug 2009, at 4:24, Madison Kelly wrote:
Hi all,
...
CREATE FUNCTION history_radical() RETURNS trigger
AS $$
DECLARE
hist_radical RECORD;
BEGIN
SELECT INTO hist_radical * FROM public.radical WHERE
rad_id=new.rad_id;
I assume you
Thom Brown wrote:
I'm not sure why you're saying that there's a 50%
chance of duplication after 7240 values though. With 33 million
combinations, I would have thought that duplications would become equally
likely at the 16,777,216 mark.
Basic probability.
I would have thought that duplications would become equally likely at the
16,777,216 mark.
Yes, at that point you're as likely to get a duplicate as a unique
one--every time you do it. You're likely to see your first duplicate long
before that point. In fact, it would be extremely unlikely to
Mindaugas G. mindau...@biovela.lt writes:
for example I have db with ip_src etc ant its data type bigint,
how must look select query what I can see ip address (int) instead of
bigint?
You might be interrested into the ip4r project:
http://pgfoundry.org/projects/ip4r/
Regards,
--
dim
--
Hi,
I need a plpgsql function to validade e-mail addresses. I have google but I
can't find any.
My question: Anyone have a function to validate e-mails?
Best Regards,
André.
On 16/08/2009 21:10, Andre Lopes wrote:
I need a plpgsql function to validade e-mail addresses. I have google
but I can't find any.
My question: Anyone have a function to validate e-mails?
There are lots of regular expressions which Google will find for you,
which you can then use with one
Two problems installing the postgresql doc package,,,
I just tried to install the 8.4 postgresql-docs
and postgresql-contrib packages from the pgdg84
Fedora-11 yum repository and yum tried to install
postresql-docs-8.4rc1 (rather than 8.4.0) from
the pgdg repo.
The exact sequence of events was
Hi,
On Sun, 2009-08-16 at 14:59 -0600, Stuart McGraw wrote:
I just tried to install the 8.4 postgresql-docs
and postgresql-contrib packages from the pgdg84
Fedora-11 yum repository and yum tried to install
postresql-docs-8.4rc1 (rather than 8.4.0) from
the pgdg repo.
Fixed it now. The
Devrim GÜNDÜZ wrote:
On Sun, 2009-08-16 at 14:59 -0600, Stuart McGraw wrote:
Second, after getting the postgresql-docs package
installed by just downloading and installing the
right rpm, I notice the FAQ subdirectory contains
the FAQ in many languages, but not english.
Intentional?
On Sun, 2009-08-16 at 18:35 -0400, Alvaro Herrera wrote:
Huh, but the tarball does not contain the FAQs in other languages
either.
See doc/src/FAQ directory in 8.4.0 tarball.
--
Devrim GÜNDÜZ, RHCE
Command Prompt - http://www.CommandPrompt.com
devrim~gunduz.org, devrim~PostgreSQL.org,
On Aug 16, 2009, at 5:07 AM, Thom Brown wrote:
Does anyone know a way to generate a random and unique lowercase
alphanumeric ID (preferably without using 0, 1, o or i to prevent
problems with users manually typing the ID) using SQL without
resorting to a prerendered table or using GUIDs.
Devrim GÜNDÜZ wrote:
On Sun, 2009-08-16 at 18:35 -0400, Alvaro Herrera wrote:
Huh, but the tarball does not contain the FAQs in other languages
either.
See doc/src/FAQ directory in 8.4.0 tarball.
Hmm, this is strange -- the directory is not there in CVS ...
/me checks CVS history
Oh, I
Ivan Sergio Borgonovo escribió:
Sometimes ago Daniel Verite posted an implementation of a fiestel
cipher in plpgsql.
It's in the wiki, in the Snippets area.
wiki.postgresql.org/wiki/Snippets
(pseudo encrypt or something like that I think it's called)
--
Alvaro Herrera
Hi,
I am kind of new into python, and I have been trying to port some plperl
functions into plpython, but I've run up into a problem.
Imagine the following plpython code.
CREATE OR REPLACE FUNCTION greet (how text)
RETURNS SETOF greeting
AS $$
rv = plpy.execute(SELECT 1)
for article in
Andre Lopes lopes80an...@gmail.com writes:
My question: Anyone have a function to validate e-mails?
Check the PG archives --- this has been discussed before. IIRC you
can't *really* validate them, short of actually sending mail.
But there are partial solutions in the archives.
On Sun, Aug 16, 2009 at 04:53:01PM -0600, Bob Gobeille wrote:
One way is to use a LFSR (linear feedback shift register function). I
haven't used one in a long time but I recall generating pseudo random
numbers that are guaranteed not to repeat after billions of
iterations. It's very
Assuming we are running a Postgres instance that is shipping log files to 2
or more warm spares, is there a way I can fail over to one of the spares,
and have the second spare start receiving updates from the new master
without missing a beat? I can live with losing the old master, and at least
hi,
i am near to PostgreSql. I create a database by the superuser. Then i create
another logon user. Now how can i protect my database from the new user. i
want to ban the access and view the database to the new user.It can done by
an entry in pg_hba file. Is there any other way to secure my
Hi All,
We have recently upgraded postgres from 7.2 to 8.3.
I am struggling with the logging options when it comes to functions.
How do log statements from within a Function?
Thanks
Andrew Bartley
On 16/08/2009 9:06 PM, NTPT wrote:
So I suggest we should have random_page_cost and
Sequential_page_cost configurable on per tablespace basis.
That strikes me as a REALLY good idea, personally, though I don't know
enough about the planner to factor in implementation practicalities and
any
Tom Lane wrote:
Andre Lopes lopes80an...@gmail.com writes:
My question: Anyone have a function to validate e-mails?
Check the PG archives --- this has been discussed before. IIRC you
can't *really* validate them, short of actually sending mail.
And getting a reply.
But there are partial
Hi All,
We have recently upgraded postgres from 7.2 to 8.3.
I am struggling with the logging options when it comes to functions.
How do log statements from within a Function?
Thanks
Andrew Bartley
Hello
2009/8/16 Andre Lopes lopes80an...@gmail.com:
Hi,
I need a plpgsql function to validade e-mail addresses. I have google but I
can't find any.
My question: Anyone have a function to validate e-mails?
Best Regards,
André.
You don't need plpgsql. Important is only an using of
On 17/08/2009 10:32 AM, Andrew Bartley wrote:
Hi All,
We have recently upgraded postgres from 7.2 to 8.3.
I am struggling with the logging options when it comes to functions.
How do log statements from within a Function?
A PL/PgSQL function?
You don't, generally.
Perhaps we should back up
Thanks Craig fro you reply,
7.2 does have statement logging from within functions.
How? these are the settings we use in our production environments. (7.2)
debug_level = 2
log_connections = off
log_pid = on
log_timestamp = on
syslog = 0
Why, we use logging fro production problem resolution.
On Sun, Aug 16, 2009 at 6:12 PM, Alvaro
Herreraalvhe...@commandprompt.com wrote:
It's in the wiki, in the Snippets area.
wiki.postgresql.org/wiki/Snippets
(pseudo encrypt or something like that I think it's called)
Here's a simple 255 value linear feedback shift register. It's
nothing fancy,
On Mon, Aug 17, 2009 at 06:43:54AM +0200, Pavel Stehule wrote:
Hello
2009/8/16 Andre Lopes lopes80an...@gmail.com:
Hi,
I need a plpgsql function to validade e-mail addresses. I have google but I
can't find any.
My question: Anyone have a function to validate e-mails?
Best
2009/8/17 David Fetter da...@fetter.org:
On Mon, Aug 17, 2009 at 06:43:54AM +0200, Pavel Stehule wrote:
Hello
2009/8/16 Andre Lopes lopes80an...@gmail.com:
Hi,
I need a plpgsql function to validade e-mail addresses. I have google but I
can't find any.
My question: Anyone have a
38 matches
Mail list logo