473,767 Members | 1,873 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

psql and \lo_import

I'm working psql v7.2.2 to postmaster v7.2.2 and want to use the
\lo_import function.

The psql manual says that the syntax is \lo_import '<filename>' 'comment'

This loads the blob OK and returns the loid but the comment gets lost and
doesn't appear when I run \lo_list

Any ideas?

--
Howard.
LANNet Computing Associates - Your Linux people <http://www.lannetlinux .com>
------------------------------------------
Flatter government, not fatter government - Get rid of the Australian states.
------------------------------------------
If all economists were laid end to end, they would not reach a conclusion
- George Bernard Shaw
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 11 '05 #1
2 5053
Howard Lowndes <la****@lannet. com.au> writes:
I'm working psql v7.2.2 to postmaster v7.2.2 and want to use the
\lo_import function.
The psql manual says that the syntax is \lo_import '<filename>' 'comment'
This loads the blob OK and returns the loid but the comment gets lost and
doesn't appear when I run \lo_list


I think the comment-on-LO facility only works if you are superuser
(because it's hacking a system table, there not being any actual
COMMENT ON LARGE OBJECT command).

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 11 '05 #2
On Mon, 22 Sep 2003, Tom Lane wrote:
Howard Lowndes <la****@lannet. com.au> writes:
I'm working psql v7.2.2 to postmaster v7.2.2 and want to use the
\lo_import function.
The psql manual says that the syntax is \lo_import '<filename>' 'comment'
This loads the blob OK and returns the loid but the comment gets lost and
doesn't appear when I run \lo_list


I think the comment-on-LO facility only works if you are superuser
(because it's hacking a system table, there not being any actual
COMMENT ON LARGE OBJECT command).


I hear what you say, but the psql manual specifically mentions that the
difference between the \lo_import command and the server-side lo_import
function is that the former "acts as the local user on the local file
system, rather than the server's user and file system". If this is the
case then why do they not specifically mention the superuser restriction
in the syntax.

To my mind this impies that this restriction (to be the superuser) does
not apply to the \lo_import command.

Further, the blob is loaded into pg_largeobject table, which surely, is a
system table.

--
Howard.
LANNet Computing Associates - Your Linux people <http://www.lannetlinux .com>
------------------------------------------
Flatter government, not fatter government - Get rid of the Australian states.
------------------------------------------
If all economists were laid end to end, they would not reach a conclusion
- George Bernard Shaw
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postg resql.org so that your
message can get through to the mailing list cleanly

Nov 11 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
12350
by: Daniel Schuchardt | last post by:
Hi @ all, i'm sure there was a psql-function to transfere my Blob-Data to the server but I can't remember. I have a script like this : UPDATE xy SET z = lo_import('localpath_and_file'); but i want to execute this script from the client and so my blob-data is
0
459
by: Jonathan Bartlett | last post by:
Is there an equivalent function for bytea columns that works like lo_import? Alternatively, is there a way to copy from a large object to a bytea column from SQL? Or maybe someone has another way of attacking this problem: I've got some Perl code that does this:
4
5221
by: Phil Campaigne | last post by:
Hi All, I just installed postgresql 7.3.4 as an upgrade to 7.3.2 and all went well untill I tried to log into a database that I successfully created. Here are the steps in question: bash-2.05b$ psql -h localhost -U postgres hardwoodthunder Welcome to psql 7.3.2, the PostgreSQL interactive terminal. Type: \copyright for distribution terms \h for help with SQL commands
7
37780
by: Willem Herremans | last post by:
I am developing a client application for postgreSQL in Tcl/Tk (see http://gborg.postgresql.org/project/pfm ). It mainly uses PgTcl or pgintcl. I don't have any problems with those, but I am also trying to call psql from my application for SQL statements typed directly by the user. I have used the Tcl command set psqlChannel
1
2195
by: Josué Maldonado | last post by:
Hello List, I'm having this issue with beta 8.0 C:\pgsql\bin>pg_dump -U postgres farmacia > xfar.sql Password: C:\pgsql\bin>psql -U postgres farmacia2 < xfar.sql Password: psql: FATAL: Password authentication failed for user "postgres" C:\pgsql\bin>psql -U postgres -W farmacia2 < xfar.sql
2
1760
by: Russ Brown | last post by:
Hello, Today I tried connecting to my database locally via psql. I got the usual welcome & basic help messages, but it never got to the prompt: it just hung. So I checked top and the psql process was increasing in size at quite a rate (up to a gig in under 30 seconds). I'd been using psql with no problems only a couple of hours ago, and I haven't installed anything for at least a couple of days that I can think of.
1
5279
by: Premsun Choltanwanich | last post by:
I try to use lo_import and lo_export for manage large object on PostgreSQL. I found that all files must be process on server with these commands. Could I make lo_import and lo_export to use file on client local machine? And How? Or Is it has other ways to manage large object that process is between client local machine and PostgreSQL database?
3
12817
nehashri
by: nehashri | last post by:
I am trying to insert a large object into my dbs using: INSERT INTO table VALUES (lo_import ( ' z/image/image.jpg ' )); but i get the message saying that I need superuser privilidges to do it and that I should use client-side \lo_import command. Does anyone know how to use that command? And what is the syntax for \lo_import and export commands?
3
4001
by: oksofar | last post by:
Hello - I'm running PG 8.1 on Windows XP. I've installed the server to run as a service. The psql command fails to connect to the server, although I can connect with other clients. When I enter psql -d mydb -h localhost -U admin I get the following response: psql: could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" and accepting
0
9571
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9405
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9841
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8838
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7383
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6655
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5424
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3930
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3533
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.