Here I would like to check:
IF param1 < 75 THEN region-in-$result-should-be-set-to-NULL
Not sure I get what all you're wanting to do from your message, but
could you use a case statement in sql to do this? Or put it in the
where clause?
I knew it too be a bit complicated to explain
Hi,
rahter dump question, I guess
But I have a table with a sequential index field, into which I would
like to add from time to time another line (via webbrowser), which in
turn, stays first empty, before it's being filled in later (via
webbrowser).
Because the ID field is sequential
Tuskenis wrote:
Hi, Stefan.
your second example should work for you.
INSERT INTO table_xx (field2, field3, field4) VALUES ('', '', '');
(keeping in mind, that your ID column is of type serial or has
DEFAULT NEXTVAL('some_sequence') ).
You can also insert
'')
Thanks a lot!!
Stef
I guess you get duplicate value error because you have previously
inserted ID column with your own values. Check the sequence
page_input_id_seq if it points to the right next value. If not -
correct it to a MAX(ID) +1
Julius Tuskenis
Stefan Schwarzer
Hi there,
I have dozens of tables where I need to rename one column in each of these. Is
there any generic way to do that?
I am not really familiar with the scripting possibilities of Postgres.
Thanks a lot for your help!
Stefan
--
Sent via pgsql-general mailing list (pgsql-general@postgresq
> Hi there,
>
> I have dozens of tables where I need to rename one column in each of these.
> Is there any generic way to do that?
> I am not really familiar with the scripting possibilities of Postgres.
>
> Thanks a lot for your help!
>
> Stefan
>
>
> You can do with script. I made one on fl
Hi there,
I upgraded my machine from Snow Leopard to Lion, and ran, as usual, into some
Postgres update problems.
I used Kyngchaos libraries for all frameworks and Postgres. Now, I'd like to
install the tablefunc/crosstab function.
But the "make" process gives me this:
cd contrib/tablefunc
ta
>> I upgraded my machine from Snow Leopard to Lion, and ran, as usual, into
>> some Postgres update problems.
>>
>> I used Kyngchaos libraries for all frameworks and Postgres. Now, I'd like to
>> install the tablefunc/crosstab function.
>>
>> But the "make" process gives me this:
>
> Looks lik
> In file included from /usr/local/pgsql-9.1/include/server/postgres.h:47,
> from tablefunc.c:33:
> /usr/local/pgsql-9.1/include/server/c.h:67:19: error: stdio.h: No such file
> or directory
> /usr/local/pgsql-9.1/include/server/c.h:68:20: error: stdlib.h: No such file
> or direc
Hi there,
I guess this is a typical user error. I searched around to find the solution,
but in vain.
I just upgraded to Lion, and used Kyngchaos libraries for installation of
Postgres.
Try to get running postgres, and I get this:
/usr/local/pgsql-9.1/bin/psql -U postgres
psql: co
On Jun 14, 2012, at 3:32 PM, Adrian Klaver wrote:
> On 06/14/2012 04:47 AM, Stefan Schwarzer wrote:
>>> In file included from /usr/local/pgsql-9.1/include/server/postgres.h:47,
>>> from tablefunc.c:33:
>>> /usr/local/pgsql-9.1/include/server/c.h:
>> Hi there,
>>
>> I guess this is a typical user error. I searched around to find the
>> solution, but in vain.
>>
>> I just upgraded to Lion, and used Kyngchaos libraries for installation of
>> Postgres.
>>
>> Try to get running postgres, and I get this:
>>
>> /usr/local/pgsql-9.1/bi
Hello,
I read through the Postgres doc and many Google results, but it seems still
unclear to me how to include additional packages into my postgres database. I
see that there are a few installed under
"/usr/local/pgsql-9.1/share/extension/" (I am on Lion and installed the
Kyngchaos libs).
>> I read through the Postgres doc and many Google results, but it seems
>> still unclear to me how to include additional packages into my postgres
>> database. I see that there are a few installed under
>> "/usr/local/pgsql-9.1/share/extension/" (I am on Lion and installed the
>> Kyngchaos libs).
>>> I guess this is a typical user error. I searched around to find the
>>> solution, but in vain.
>>>
>>> I just upgraded to Lion, and used Kyngchaos libraries for installation of
>>> Postgres.
>>>
>>> Try to get running postgres, and I get this:
>>>
>>> /usr/local/pgsql-9.1/bin/psql -U
>> I need unfortunately to come back to this issue. I (again) re-installed Lion
>> from scratch, and finally got everything working. The Postgres was running,
>> I uploaded a couple of dumped SQL files. And then re-started the machine for
>> another reason. And suddenly it says again the it can
I read through the Postgres doc and many Google results, but it seems
still unclear to me how to include additional packages into my postgres
database. I see that there are a few installed under
"/usr/local/pgsql-9.1/share/extension/" (I am on Lion and installed the
Kyngcha
>> I do as indicated in Kyngchaos ReadMe file:
>
>>export PATH="/usr/local/pgsql-9.1/bin:$PATH"
>>export USE_PGXS=1
>>make
>>sudo make install
>
> I'm beginning to wonder who are Kyngchaos and whether they are competent
> at all. They obviously didn't test the above advice. It d
>>
>> When I do: sudo launchctl load
>> /Library/LaunchDaemons/org.postgresql.postgres.plist
>> it says: org.postgresql.postgres: Already loaded
>>
>> When I do: /usr/local/pgsql-9.1/bin/initdb -U postgres -D
>> /usr/local/pgsql-9.1/data --encoding=UTF8 --locale=en_US
>> it s
> sudo su - _postgres /usr/local/pgsql-9.1/bin/initdb -U postgres -D
> /usr/local/pgsql-9.1/data --encoding=UTF8 --locale=en_US
> sudo su - _postgres /usr/local/pgsql-9.1/bin/pg_ctl start -D
> /usr/local/pgsql-9.1/data
>
> Although I don't get an error message, I don't have the feeling that it
>>> 1) Do the above files actually exist in the above location?
>
>> Yes, the c.h exist in the mentioned location. However, as it does not
>> indicate where it looks for the stdio.h, perhaps the problem lies there.
>
> Indeed. Where did you get the advice to use "-isysroot
> /Developer/SDKs/Mac
Hi there,
I am pg_dump-ing all tables from schema public on the server
/usr/local/pgsql/bin/pg_dump -U user my_database --schema=public
--encoding=UTF-8 > dump.sql
and re-loading it via psql on my local machine.
But instead of having 708 tables as on the server, I end up with only 570
>> Hi there,
>>
>> I am pg_dump-ing all tables from schema public on the server
>>
>> /usr/local/pgsql/bin/pg_dump -U user my_database --schema=public
>> --encoding=UTF-8 > dump.sql
>>
>> and re-loading it via psql on my local machine.
>>
>> But instead of having 708 tables as on the ser
>>> sudo su - _postgres /usr/local/pgsql-9.1/bin/initdb -U postgres -D
>>> /usr/local/pgsql-9.1/data --encoding=UTF8 --locale=en_US
>>> sudo su - _postgres /usr/local/pgsql-9.1/bin/pg_ctl start -D
>>> /usr/local/pgsql-9.1/data
>>>
>>> Although I don't get an error message, I don't have the feeli
> I just went back to the postgres documentation [1] (actually reading all
> google results on the error message one after the other) and tried out what
> was said there (adapted to my conditions):
>
> sudo -u _postgres /usr/local/pgsql-9.1/bin/postgres -D
> /usr/local/pgsql-9.1/data
>
> and s
Hi there,
I am using 9.1.3. I inserted the tablefunc extension, into a SCHEMA called
tablefunc, in order to separate it from my tables. I had to create it as
postgres user, but changed than the Owner of both schema and functions to my
user XXX.
Now, when I launch a query which includes "crosst
>>> Now, when I launch a query which includes "crosstab()" as a postgres user,
>>> everything works fine. However, if I launch it as user XXX, it complaints:
>
>> Are you schema qualifying the function name when you use it?
>> If not, does user XXX have schema tablefunc in their search_path?
>
>
> Now, when I launch a query which includes "crosstab()" as a postgres
> user, everything works fine. However, if I launch it as user XXX, it
> complaints:
>>>
Are you schema qualifying the function name when you use it?
If not, does user XXX have schema tablefunc in their
> If the textual value of search_path (as per "show search_path") lists
> the schema but current_schemas() doesn't, I have to think that you've
> got a permissions problem --- the system will silently ignore any
> search_path entries for which you don't have USAGE permission.
> You said you'd done
Hi there,
not being an expert for Postgres…. I have a Postgis table with the countries of
the world. Now, I would like to drop it. I got the error message:
ERROR: out of shared memory
HINT: You might need to increase max_locks_per_transaction.
and thought that it would be easier to
> not being an expert for Postgres…. I have a Postgis table with the countries
> of the world. Now, I would like to drop it. I got the error message:
>
> ERROR: out of shared memory
> HINT: You might need to increase max_locks_per_transaction.
>
> and thought that it would be easier
Hi there,
strange thing, but every time I need to (re)install the tablefunc, I run into
problems.
I am using the Kyngchaos packages for Snow Leopard. Everything works smoothly,
until I arrive at the additional, manual installation of tablefunc.
I downloaded the correct version of the postgres
Hi there,
strange thing, but every time I need to (re)install the tablefunc, I run into
problems.
I am using the Kyngchaos packages for Snow Leopard. Everything works smoothly,
until I arrive at the additional, manual installation of tablefunc.
I downloaded the correct version of the postgres
Hi there,
I deleted involuntarily my tablefunc functions in my database. Now, I
am trying to get them back into it again. But without success.
I am running Mac OS X, 10.5, with postgres 8.3.1 and have used the
Kyngchaos packages. It seems to me that before I succeeded in doing
this from w
But when I do this I get this error message:
Makefile:17: ../../src/Makefile.global: No such file or directory
Makefile:18: /contrib/contrib-global.mk: No such file or directory
make: *** No rule to make target `/contrib/contrib-global.mk'.
Stop.
What is the problem? What
The following does basically the same thing, but I find it a bit
easier
to follow:
sudo -u postgres /usr/local/pgsql/bin/pgsql < tablefunc.sql
Thanks for that. Looks indeed less complicated! :-)
But not yet success for me:
I did re-start, just to be sure.
for postgres:
./configu
Hi there,
probably not too complicated, but although googling my way through
many pages, I don't find the solution.
I have a query which uses already an apostrophe to escape something
else:
$query = "SELECT
*
FROM
crosstab('S
Hi there,
gush, shouldn't be that complicated. But neither in Postgres, nor in
Access I succeed in getting the result I wish.
I have a couple of times for the Environmental Conventions (Kyoto,
Montreal, CITES etc.). They look like this:
id_country,year,value
4,1992,0
4,1993,0
4,1994,0
4,1
Select countries.name, basel.year, basel.value, cites.year,
cites.value
From countries
Left Join basel on basel.id_country = countries.id_country and
basel.value=1
Left Join cites on cites.id_country = countries.id_country and
cites.value=1
I would have thought so, but the query turns fore
Select countries.name, basel.year, basel.value, cites.year,
cites.value
From countries
Left Join basel on basel.id_country = countries.id_country and
basel.value=1
Left Join cites on cites.id_country = countries.id_country and
cites.value=1
I would have thought so, but the query turns forever.
Select countries.name, basel.year, basel.value, cites.year,
cites.value
From countries
Left Join basel on basel.id_country = countries.id_country and
basel.value=1
Left Join cites on cites.id_country = countries.id_country and
cites.value=1
I would have thought so, but the query turns forever.
You may also wish to review Andreas' suggestions as they propose a
more sensible table structure rather than having a table for each
convention.
The table proposal really looks nice. But our database is structured
by variable - so each convention has its own table.
It is a really bad design -
Hi there,
I have tables with values for each country of the world.
Now, there is the possibility for the user to generate regional
(Europe, Africa...) or subregional (Western Europe, Central Europe...)
aggregations on-the-fly. In some cases, these aggregations need to be
calculated by usin
SELECT
COALESCE(r.name, ) AS name,
d.year_start AS year,
SUM(d.value * d_nom.value) / SUM(d_nom.value) AS value
FROM
pop_total_access_water AS d
RI
Hi there,
how comes that sometimes, when I use something like this:
psql name_of_my_database < inserts.sql
Postgres displays
INSERT 0 1
INSERT 0 1
INSERT 0 1
but sometimes it counts
INSERT 48593 1
INSERT 48594 1
INSERT 48595 1
???
Altho
; WHEN a=2 THEN 'two' ELSE 'other' END FROM test; a | case---+--- 1 | one 2 | two 3 | otherdoesn't work either, cause the titles of my columns are very varied...Thanks for any advice,Stefan Schwarzer _______Stefan Schwarzer
On Thu, Sep 07, 2006 at 07:45:19AM +0200, Stefan Schwarzer wrote:
Hi there,
is there a simple way to replace NULL values in multiple columns
within the SQL statement? I changed the underlaying country template
of your database; so now there are a couple of NULL values when I
join the stats
and in
what circumstance?
I imagine your table looks like this
ID,country,1950,1951,1952,1953,
1 usa50 null 70 10
2 canada 10 45 null 4
Please mention what you would like to do with this?
Stefan Schwarzer wrote:
On Thu, Sep 07, 2006 at 07:45:19AM +0200, Stefan Schwarzer wrot
lesce(datafield,-) as datafield,... and that
will change all nulls to -9999 and give it the correct fieldname.
Stefan Schwarzer wrote:
I have an internet map server connected to my database. Until now,
"no data" fields within the table were filled with a "-",
101 - 149 of 149 matches
Mail list logo