On Fri, Aug 21, 2009 at 10:49:52AM -0400, Merlin Moncure wrote:
> On Fri, Aug 21, 2009 at 10:17 AM, Sam Mason wrote:
> > CREATE TYPE foo AS ( i int, j int );
> >
> > SELECT (id((SELECT (1,2)::foo))).*;
> >
> > or am I missing something obvious?
>
> I t
$1; $$;
SELECT (id((1,2))).*;
But this seems nasty and bumps up against the annoying "record type has
not been registered" that I hit all to often. More fiddling gets to:
CREATE TYPE foo AS ( i int, j int );
SELECT (id((SELECT (1,2)::foo))).*;
or am I missing something obvious?
elp to wrap the generate_series call into a function so you
don't have to refer to "myPkArray" so many times.
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
mat for literals that appear in your SQL code.
Sam
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
When you get a response you know the email address is actually useful
for contacting the user, rather than it being a typo and going somewhere
else.
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
es
that the column order is the same as when it was created but there are
(unimplemented) suggestions about how to "fix" this. See for example:
http://archives.postgresql.org/pgsql-hackers/2006-12/msg00983.php
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list
in ways
> far too convoluted to use a single query with UNION and ORDER BY, and
> then returning the results.
Sounds like you want a temp table to keep things in; you can add an ON
COMMIT DROP which should help keep things tidy. If you're on 8.4 the
WITH clause may make this use
27;s just a character string
to the database. To go to the other extreme, referential integrity
is (almost?) always best done inside the database as it has all the
information needed to do the right thing.
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@pos
n and hence if you write something into a logging table
you're going to loose it if the transaction rolls back.
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
On Tue, Aug 18, 2009 at 08:21:49PM -0400, Tom Lane wrote:
> Sam Mason writes:
> > On Tue, Aug 18, 2009 at 03:50:47PM -0600, Bob Gobeille wrote:
> >>> CREATE INDEX "ufile_name_search" ON "public"."uploadtree" USING GIN
> >>> (&quo
x on a plain TEXT column it's saying
that it doesn't how to use those operators with a values of TEXT type.
As soon as you pull this value apart (with the to_tsvector) you end up
with something that PG can get some traction on and all is good.
Maybe a useful question to ask is, what are y
On Tue, Aug 18, 2009 at 05:24:52AM -0700, John R Pierce wrote:
> Sam Mason wrote:
> > SELECT course, date, COUNT(*)
> > FROM application_preferred_date
> > GROUP BY course, date;
>
> the problem as stated is more complex than that. A student could, in
> theory,
about EnterpriseDB
specific features, I'd recommend asking on EnterpriseDB forums.
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
9-08-28'),
('cs1234','database 101','2009-08-31');
If I wanted to know how many people wanted to do each course on each
date, I'd just do:
SELECT course, date, COUNT(*)
FROM application_preferred_date
GROUP BY course, date;
Hope that gives you some ideas!
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
untu) then this
is how it works by default. You can have as many different "major"
(i.e. 8.2, 8.3 and 8.4) versions installed and running at the same time
as you want.
Building from source isn't too hard though, it's the keeping it up to
date that's more of a fiddle.
--
On Tue, Aug 18, 2009 at 10:32:35AM +0200, Daniel Verite wrote:
> Sam Mason wrote:
> > I've just realized another case where it's not consistent; why does the
> > following return true:
> >
> > SELECT row(null) IS NULL;
> >
> > and yet the fol
get the most recent message between two users?
More details would help, but failing that how about:
SELECT DISTINCT ON (to_user, from_user) id, to_user, from_user, created
FROM messages
ORDER BY to_user, from_user, created DESC;
That would only chop out id=1 from the above list.
--
Sam http
he number of microseconds since 2000-01-01,
otherwise it's a double representing the number of seconds since the
same date. I don't know perl well enough to know if what you're doing
is the right thing, but the values you're getting out don't look right
to me.
--
Sam h
you seem to suggest then having
them as separate functions would make this easier.
If they really are that similar then you should have all the data in one
table anyway!
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to
On Mon, Aug 17, 2009 at 04:00:54PM +0200, Harald Fuchs wrote:
> In article <20090816122526.gw5...@samason.me.uk>,
> Sam Mason writes:
>
> > I've just had a look and PG does actually seem to be returning values as
> > I'd expect, i.e. 0 <= n < 1.
>
ot; to mean the same as "v IS NOT DISTINCT FROM NULL",
this being the same as "NOT (v IS DISTINCT FROM NULL) lots of times, but
if I'm interested in knowing if a member of a RECORD is NULL then I want
to know specifically which attribute it is.
I think I'm saying that PG sho
On Mon, Aug 17, 2009 at 12:17:29PM +, Jasen Betts wrote:
> On 2009-08-17, Sam Mason wrote:
> (i.e. their internal state is the same as
> > it was before) but individual numbers *will* be repeated.
>
> numbers will not be repeated intil the state wraps if the number
> re
e I found recently is a SIMD implementation of
the "Mersenne Twister" called SFMT[1].
--
Sam http://samason.me.uk/
[1] http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
alled the birthday attack and it's one of the basic tests
for hash functions--any bias in their output will shrink this number
even further.
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
ator is defined to return a value between 0 and 1 inclusive, it's
generally much more useful if it runs from 0 to less than 1 and would
mean that I wouldn't need the "mod" above and would remove the (slight)
biasing towards choosing 'a'.
--
Sam http://s
{A,B,C},{D,E,F}}'::text[]);
and you'd get back your six rows. It appears to do the correct thing
with arrays of higher dimensionality to me, but I only tried up to five.
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
o that PG doesn't get confused between the type
declaration and the array indexing.
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
me PG spends trying to keep it full
the more it's got to keep rearranging it, the more empty space there is
the more time it's got to spend looking for the right thing. I don't
really know if 80% is good here, but it doesn't sound bad.
--
Sam http://samason.me.uk/
-
k forward to having such a feature in Postgres actually. Right
> now, I'm using cron to do those checks.
You could use one of the embedded languages (plperl or plpython) to do
the sending of emails if you want. You'd still need something "outside"
the database to actually start
here are and hence
each row knows if a new column is going to be off the end and means it
doesn't need to rewrite the table when adding a new NULLable column.
I made a suggestion about how to generalize this to non-NULLable columns
with a default value, but haven't written a
7;ve looked through I've not found anything definite either
way. I think my interests here are more pedagogical that anything else,
but PG's behavior is somewhat inconsistent and it could be nice to
figure out what the "best" way of fixing these inconsistencies are.
--
Sam
On Fri, Aug 14, 2009 at 12:03:37AM +0100, Greg Stark wrote:
> On Thu, Aug 13, 2009 at 11:20 PM, Sam Mason wrote:
> > Is it worth having a note about having enough memory floating around
> > for those limits to actually be hit in practice? There would be no
> > way of creatin
Is it worth having a note about having enough memory floating around
for those limits to actually be hit in practice? There would be no
way of creating a row 1.6TB in size in one go, it would be ~800 UPDATE
statements to get it up to that size as far as I can see.
--
Sam http://samason.me.uk/
other way how to index this? Expressions?
I think you want a GIN index; have a look at:
http://www.postgresql.org/docs/current/static/indexes.html
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
playing around with running psql with -E.
--
Sam http://samason.me.uk/
[1] http://www.postgresql.org/docs/current/static/information-schema.html
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
#x27;s bad, I think it's mainly because it may mask other problems
later on. It's not going to affect much fundamental either way though.
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http:/
me and other people about
this. It's basically awkward interaction with the optimizer not being
able to expand this out because it may change behavior. Try:
http://archives.postgresql.org/pgsql-general/2009-06/msg00233.php
IMMUTABLE is good though, don't go removing that
ble
quotes. For example, if we evaluate the above:
SELECT '{"elem1","elem2","elem_n"}'::TEXT[];
(sadly the normal literal syntax doesn't work for arrays) we get back:
{elem1,elem2,n}
So, PG has read in the literal, turned it into a real valu
you don't stuff rows into columns :)
When you say "columns", do you mean the value associated with a
particular attribute in a particular row of a particular table? Surely
this is a normal value and just because it happens to be stored in a
table it shouldn't be any different f
E 'sql' IMMUTABLE STRICT
I'd recommend taking off the "STRICT" from this. It will, counter
intuitively, slow things down when you're not expecting it.
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make c
On Wed, Aug 12, 2009 at 08:02:10PM +0200, Daniel Verite wrote:
>Sam Mason wrote:
> > But it seems to be a somewhat arbitrary choice to handle
> > IS NULL for rows differently from everything else.
>
> For scalar or array types, "is null" means that the value hap
eral case
of an exponential increase in complexity, but it's still nasty.
Anybody else think this thread is past it's bed time and should be put
to rest?
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
ow that consists
entirely of NULL values being treated as NULL is OK, but some weird
halfway house is horrible. Standards' conforming, but still horrible.
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
30min
checkpoint_segments = 10
checkpoint_completion_target = 0.9
Not sure what other config settings are pertinent here, but I can supply
them if required.
I am using postgresql 8.3.7-0ubuntu8.04.1, running on an OpenVZ VPS.
Thanks for any pointers.
Sam Mulube
st as normal and if it fails because the connection
was closed then you can open a new one and try again.
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
ARY KEY (msgid, ord),
type TEXT CHECK (type IN ('to','from','cc','bcc')),
address TEXT
);
CREATE INDEX mailaddrs_address_idx ON mailaddrs (address);
then you can do:
SELECT DISTINCT msgid
FROM mailaddrs
WHERE address ILIKE 'david%';
rom a device
that doesn't have "users"?
Maybe the "current_user" variable[1] helps?
--
Sam http://samason.me.uk/
[1] http://www.postgresql.org/docs/current/static/functions-info.html
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To ma
above works fine on a linux box using emacs to access PostgreSQL.
Yes, this is much more reliable in my experience.
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
FROM (VALUES (1,'hi'), (2,'bye')) x(i,v)
WHERE f.id = x.i;
The "best" solution depends on the details of the problem though!
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscrip
there a way to get the list of SQL statements that were previously
> executed as part of a given transaction?
I'd play with logging and setting your "log_line_prefix"[1] to include
the process id and "log_statement" to "all". It's then a simple matte
"sorrend::integer > 9" and it
> > should work ;-)
>
> That's kinda what I was thinking at first, but the pastebin he posted
> showed them in proper int type order.
Also the fact that 12 "works".
> Otherwise we're blind men describing an elephan
7;s the way things
are. We can try and suggest ways to make writing your tests easier, but
I'm not sure what else we can do.
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
common setup if you have 20+ test boxes!) than
to bake in a large set of assumptions into your test scripts?
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
bad. See:
http://wiki.postgresql.org/wiki/FAQ#Can_PostgreSQL_be_embedded.3F
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
o declare
local variables with an underscore prefix such as "_col1" in your
example.
> Is there another way other than just simply rename the variable?
I don't think so.
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
issions to access it.
You probably need to do:
ALTER TABLE users OWNER TO sample;
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
\copy is a special command in psql that does a copy from the system that
psql is running in, rather than a normal COPY command that runs on the
server.
I believe \copy is implemented as a COPY FROM STDIN... with psql
automatically piping the data over the connection for you.
--
Sam http://sam
trick
You'll want to use the real CSV parser then, the code in psql would look
like this:
\copy gisp FROM 'd:/projects/gisp/gisp.csv' WITH CSV
PG and MS Excel have an almost identical definition of what a CSV file
should look like, opening the file in Excel is always a good quick check
to generate a microsecond spaced series covering several years:
CREATE FUNCTION generate_series(timestamp,timestamp,interval)
RETURNS SETOF timestamp
LANGUAGE plpgsql
IMMUTABLE AS $$
DECLARE
_c timestamp := $1;
BEGIN
WHILE _c < $2 LOOP
RETURN NEXT _c;
special letters to
> simple ones.
It would be easy to write a regex to strip out the invalid characters if
that's what you want.
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.po
On Sun, Aug 02, 2009 at 06:03:11PM +0200, Pavel Stehule wrote:
> 2009/8/2 Sam Mason :
> > On Sun, Aug 02, 2009 at 05:22:45PM +0200, Pavel Stehule wrote:
> >> 2009/8/2 Sam Mason :
> >> > On Sun, Aug 02, 2009 at 02:20:18PM +0200, Pavel Stehule wrote:
> >> &
On Sun, Aug 02, 2009 at 05:22:45PM +0200, Pavel Stehule wrote:
> 2009/8/2 Sam Mason :
> > On Sun, Aug 02, 2009 at 02:20:18PM +0200, Pavel Stehule wrote:
> >> There is paradox - IMMUTABLE function break inlinig :(. There is maybe bug
> >
> > Not in any tests I'v
On Sun, Aug 02, 2009 at 02:20:18PM +0200, Pavel Stehule wrote:
> 2009/8/2 Sam Mason :
> > On Sun, Aug 02, 2009 at 12:08:28PM +0100, Oliver Kohll - Mailing Lists
> > wrote:
> >> CREATE OR REPLACE FUNCTION gtpb_divide(integer, integer) RETURNS integer
> >
s going to be less of an issue with division that other
operators, but it's worth bearing in mind. The "IMMUTABLE" options is a
good one to specify though, keep that!
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
unction ?
Either use something like date_trunc[1], convert it to a string with
to_char[2], or create a table that contains what you consider to be your
week ranges in (i.e. year, week, startdate, enddate).
--
Sam http://samason.me.uk/
[1]
http://www.postgresql.org/docs/current/static/functi
PG, the things that will help
you are roles[1], views[2], and functions[3] with "security definer"
set.
--
Sam http://samason.me.uk/
[1] http://www.postgresql.org/docs/current/static/user-manag.html
[2] http://www.postgresql.org/docs/current/static/sql-createview.html
[3] http://www.
ot;pNOME" varchar, "pNOME_ABREV" varchar,
[..]
> VALUES ( pID_SOCIEDADE,
You're mixing and matching quoting of identifiers, sometimes you use
"pID_SOCIEDADE" and other times just pID_SOCIEDADE (i.e. without the
quotes) and these are different identifiers. You need to pick
On Thu, Jul 30, 2009 at 03:09:12PM +0200, Radek Novotnnn wrote:
> Is there possible to create pg trigger that runs shell script?
Yes, pl/perl can do this.
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to y
e bytea value
out into the filesystem.
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
ng
to test the client connections every once in a while to see if they're
still valid.
The postmaster seems like a reasonable place to do this to me, it has
all the descriptors it just discards them at the moment.
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing
On Wed, Jul 29, 2009 at 01:15:27PM +, Jasen Betts wrote:
> On 2009-07-23, Sam Mason wrote:
> >
> > http://www.postgres.cz/index.php/PostgreSQL_SQL_Tricks#Attention_on_IS_NULL_and_IS_NOT_NULL_operators_for_composite_types
> >
> > is scary; even worse is that it
On Tue, Jul 28, 2009 at 11:26:01AM -0400, Robert James wrote:
> On Tue, Jul 28, 2009 at 9:47 AM, Sam Mason wrote:
> > On Tue, Jul 28, 2009 at 09:14:38AM -0400, Robert James wrote:
> > > Many wrote that the functional programming 'fold' is a good model for
> > &g
instance, there are 10 bags each weighing 5 lbs, and
> you want SUM(weight) - you need to project weight onto a collection which
> allows for 10 occurences, or define the aggregate function to work on the
> whole tuple somehow... I know a man named Krug worked out a formal theory
> for this...
sers u, users_locations l
WHERE u.id= l.user_id
AND u.birthday <= l.created
ORDER BY u.id, l.created
Untested, but hopefully gives enough hints about where to look!
--
Sam http://samason.me.uk/
[1] http://www.postgresql.org/docs/current/static/sql-select.html#SQL-DISTINCT
--
s a "fold" from normal functional
programming. The Wikipedia page is a reasonable description:
http://en.wikipedia.org/wiki/Fold_(higher-order_function)
Not sure how helpful that is though!
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@post
uments; python
makes this sort of thing reasonably easy if you want to stay reasonably
low level or there are lots of frameworks around to simplify things.
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subs
ave to run the query twice?
Wouldn't that be a temporary table?
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
atly only foreign key constraints are affected by this setting,
but I believe there are plans to extend this further.
--
Sam http://samason.me.uk/
http://www.postgresql.org/docs/current/static/sql-set-constraints.html
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To ma
usly for large files (i.e. a GB
and over) it's not going to work, but I'd still expect tools to work
("less -n" seems to be my tool of choice at the moment).
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make chan
cks#Attention_on_IS_NULL_and_IS_NOT_NULL_operators_for_composite_types
is scary; even worse is that it was changed to be like this in 8.2
because the standard says it should behave this way. What on earth were
they thinking when they defined the standard this way?
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing l
orks then you've got the option of dumping the old data
that was stashed away above and update the config file to point straight
to the new location.
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscripti
oblems displaying million character
> lines,
>
> I expect ther big guns "vim" and "emacs" also have no problems with
> long lines.
GNU Emacs is fine; just tried with a line consisting of a million copies
of "helloworld " and it was a bit slow with som
at least that's what looks strange to me now--not sure how it got moved
though!
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
ike this be more amenable to optimization:
CREATE FUNCTION tbl_auditor() RETURNS BOOLEAN IMMUTABLE AS $$
logquery;
RETURN TRUE; $$;
CREATE VIEW tbl_view AS
SELECT * FROM tbl WHERE tbl_auditor();
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-g
enerating CSV files and hence will
probably be easier to get correct.
--
Sam http://samason.me.uk/
[1] http://www.postgresql.org/docs/current/static/sql-copy.html
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
that the id column in those tables uniquely identify the rows in the
table? This isn't going to make it slow, but will cause you to get a
non-deterministic (i.e. normally "wrong") answer.
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgre
On Tue, Jul 21, 2009 at 02:29:12PM -0400, Merlin Moncure wrote:
> On Tue, Jul 21, 2009 at 10:47 AM, Sam Mason wrote:
> > On Tue, Jul 21, 2009 at 04:08:51PM +0600, Murat Kabilov wrote:
> >> I would like to know if there is a function that extracts an element by its
> &
NCTION array_index(anyarray,int)
RETURNS anyelement IMMUTABLE
LANGUAGE sql AS $$
SELECT $1[$2]; $$;
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
\xBF]{3}|$$|| -- planes 4-15
$$\xF4[\x80-\x8F][\x80-\xBF]{2}$$|| -- plane 16
'*)$' );
This seems to do the right thing for me in an SQL_ASCII database.
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
ng
for every table and almost certainly not just blindly doing it on the
table's primary key.
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
not had to solve a hard
problem here.
> (3) Give input to me so that I can write a good tutorial to post on
>the postgres site?
There's already a page on the postgres wiki about this[3], maybe
something needs clarifying?
--
Sam http://samason.me.uk/
[1] http:/
casting and forcing users to
explicitly say that this is what they want.
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
On Sun, Jul 19, 2009 at 02:56:04PM +0200, Andreas Kretschmer wrote:
> Sam Mason wrote:
> > The problem with just having an index on either column is that it's
> > difficult to combine them and PG hence just thinks that it will be
>
> Since 8.1 PG can do an bitmap ind
identifier you specified.
BTW, if you're concerned about insert performance then the less indexes
you have the better.
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
ifferent priority becomes a distinct
> tuple.
I think you just want to swap the ORDER BY columns around; i.e:
ORDER BY part_number, priority
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
ld run pg_dump on another host,
or do something like:
pg_dump mydb | gzip | ssh otherbox "cat > out.sql.gz"
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
<> [test for empty array?]
Something like the following should do the right thing:
SELECT x FROM (
SELECT xpath('//entry[contains(p, ''searchtext'')]/@*', docxml) AS x
FROM docs) AS y
WHERE array_upper(x, 1) > 0;
--
Sam http://samas
you're using unusual bounds on your
array.
Bah, the semantics of arrays in PG always seem over-complicated to me!
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
FROM from_t f LEFT JOIN to_t t ON f.num = t.num
WHERE f.num > 2
AND t.num IS NULL;
The SELECT DISTINCT part tells the database to only return distinct
values from the query. The LEFT JOIN tells the database to filter out
anything that already exists in the "to_t" table.
--
quot;share" locks
(multiple transactions can have a share lock on any table or row) and
"update" locks (this locks out share and other update locks).
--
Sam http://samason.me.uk/
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscri
301 - 400 of 812 matches
Mail list logo